...

View Full Version : delay appearance of dropdown menu



Snetty
02-26-2007, 12:31 PM
I've got alot of dropdown menu's on each page of a site that I'm working on. They're very simple css driven, but I want to add a time delay to the menu's appearance when you hover over the link.

Is there a javascript way of inserting a setTimeout() whenever display: none; is changed to display: block?

Thanks alof for your help in advance.

BarrMan
02-26-2007, 12:35 PM
Try this:


If (obj.style.display == "none")
window.setTimeout("displayIt()",delay_time);

Snetty
02-26-2007, 02:35 PM
Try this:


If (obj.style.display == "none")
window.setTimeout("displayIt()",delay_time);


I'm sorry.. but I really don't get that code at all

BarrMan
02-26-2007, 02:39 PM
I'll add comments:

If (obj.style.display == "none") //checks if the obj is displayed
window.setTimeout("displayIt()",delay_time); //sets a timeout for the time delay_time has and calls displayIt function afterwards which then sets the display to block.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum