...

View Full Version : how to add a time delay to a onmouseover tag



birgit
06-13-2003, 01:14 PM
hello,

the site i'm working on has a dhtml navigation. the menus
open/close on mouseover an image:

<a href="javascritp://">
<img src="image.gif"
onMouseOver="popUp('menu1',event)"
onMouseOut="popDown('menu1')">
</a>

but sometimes users just want to move their mouse to some-
thing else above and don't want the menus to open. i'd like
to add a time delay function to be shure, that the user wants
to see the menu - let's say after 1/2 sec. over the image the
menu opens... i guess i need something like a settimeout..

but i don't have a clue how this might work.. any ideas??

thank you for your help,

birgit

Skyzyx
06-13-2003, 04:37 PM
I haven't tested this, but I don't see why it wouldn't work.



<a href="javascript:void(0);">
<img src="image.gif" onmouseover="setTimeout("popUp('menu1', event)", 500);" onmouseout="popDown('menu1');">
</a>


BTW, you should begin to get in the habit of typing all tags and attributes in all-lowercase. That is the way of the XHTML future. :D



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum