Jump to content

JS hover delay script?


PicnicTutorials

Recommended Posts

Good morning,

 

Is there a simple way to change this script so it uses classes, or directly targets the li, for the hover delay? That is, rather than having the mouseover and onmouseout events in the html? So that would be unobtrusive right?

 

http://javascript-array.com/scripts/simple_drop_down_menu/

Link to comment
Share on other sites

Aren't there any JS'ers around here anymore? Put on hold what I asked in the first post. First I need to just get the thing working. I messed with it for some time but was unable. Everything is there on that page (above link). You can do a source code copy and paste and the demo menu still holds the drop down in place on mouseout. Although, I need mouseover and mouseout delay.

 

I'm want to put it into my mega menu. http://www.visibilityinherit.com/projects/mega-drop-down.php but as usual, I fall on the JS (thats getting old!). Thanks!

Edited by Eric
Link to comment
Share on other sites

You know, IMHO, JS is the freshest best language ever created and you should use it for everything, especially rollovers, nothing does it better!

 

*snicker* just thought I would see if you still read anything I write ref. to JS. Or if you just ignore them knowing how I feel about JS and JS Rollovers ;) Bummer I missed April first for this. :D

Link to comment
Share on other sites

Eric,

I hate to do this, but if you still require some assistance on this issue, I suggest that you post a Topic over at the w3schools site. There are some pretty fair js folks over there. In particular, Deidres_Dad and justsomeguy would be some good sources for js support on that Forum.

 

I really hate to guide you away from the Killersites Forum, but ...

Link to comment
Share on other sites

  • 2 weeks later...

Basic onmouseout delays can be achieved with setTimeout javascript.

 

onmouseout="setTimeout(myFunction, 5000);"

 

myFunction can add or remove the classes. 5000 means 5 second delay.

 

But there's much much easier ways to achieve these things now using Javascript libraries such as jQuery or Prototype or MOOTools etc. You should head over to their websites and check them out. My personal favorite is jQuery for it's extensibility and it's simplicity! jQuery basically makes Javascript code human readable :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...