[Laszlo-user] mouse hover code?
jamesr
circlecycle at gmail.com
Sun Jul 8 14:41:44 PDT 2007
**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 <henry.minsky at gmail.com> 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
> hminsky at laszlosystems.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.openlaszlo.org/pipermail/laszlo-user/attachments/20070708/911fc46f/attachment.html
More information about the Laszlo-user
mailing list