**this is just from memory, please make sure the order of parameters and
names of methods on LzTimer are right.

Explanation: This piece of code will setup a timer on mouseover. If the
timer fires, the hover is triggered, showing something. If a mouseout is
received, the timer is removed and the hover is turned off. This is one
possible pattern, but most all will use a timer one way or another.

HTH!
Code:

<view>   ....

  <handler name="onmouseover">
     var this.hoverDelegate = new LzDelegate(this, 'hover');
     LzTimer.add(this.hoverDelegate, 500);
  </handler>

  <handler="onmouseout">
     LzTimer.remove(this.hoverDelegate);
     this.hover('off');
  </handler

  <method name="hover" args="state">
     if(state == 'off'){
        this.something.setVisible(false);
     }else{
        this.something.setVisible(true);
     }
  </method>


  <view name="something" visible="false">
     ...
  </view>

  ...
</view>


On 7/8/07, Henry Minsky <[EMAIL PROTECTED]> wrote:


I want to make a view which displays a pop up when the mouse hovers over
it for a few seconds. Is there
any pre-written code I can use as an example?

Thanks


--
Henry Minsky
Software Architect
[EMAIL PROTECTED]


Reply via email to