Jump to content
Killersites Community
PicnicTutorials

JS hover delay script?

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/

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Well... I only use JS for the iceing on the cake. In which cases, it's the best language there is. To bad I suck at it!

 

That reminds me of - "Hulk, strongest there is!" Hulk vs Wolverine cartoon - it was awesome!

Share this post


Link to post
Share on other sites
LOL - Sorry Wolverine fan here.

 

Me too! Thats just what The Hulk was saying while he was smashing Wolverines' head 5 feet into the ground. Of course he quickly recovered! Ultamately, wolverine was going to win (Hulk was getting tired), but then the bad mutants tranked them...

Share this post


Link to post
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 ...

Share this post


Link to post
Share on other sites

Cool - thanks! There's a couple of JS'ers around here that can do anything with it. They must be away. I'll try over there if I get stuck again. But now I found a nice jquery plugin that can do it, called hoverintent. I'll try my hand at that. Even I shouldn't be able to boch that up...

Share this post


Link to post
Share on other sites

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 :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×