Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jun 2003
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    how to add a time delay to a onmouseover tag

    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

  • #2
    Regular Coder Skyzyx's Avatar
    Join Date
    Aug 2002
    Location
    Silicon Valley, CA
    Posts
    980
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I haven't tested this, but I don't see why it wouldn't work.

    Code:
    <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.

    Creator of SimplePie and Tarzan AWS, co-founder of WarpShare, co-built the Y! Messenger website, usability-focused, and an INFJ personality.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •