Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Settimeout on layer

Status
Not open for further replies.

dugen

Programmer
Jun 16, 2003
59
US
Hi,

I am trying to use javascript on mouseout to allow a dropdown menu to stay open for a second. I am using a layer for the dropdown menu. I am looking for a function that can do this.

Here is a function that i tried, but could not get to work correctly:


function delayHideMenu(Layer1) { settimeout("hideMenu(Layer1)",1000); }


Here is the html code for the drop down menu:

<img src="images/nav_practices_off.jpg" alt="" name="nav_practices_off" width="84" height="27" border="0" id="nav_practices_off" onmouseover="MM_swapImage('nav_practices_off','','images/nav_practices_on.jpg',1);MM_showHideLayers('Layer1','','show')" onmouseout="MM_swapImgRestore();MM_showHideLayers('Layer1','','hide')" /></a></td>


Thanks for any help,

 
I can only guess from the function calls on the image that the hideMenu function is expecting a string, since Layer1 is wrapped in quotes in each function call. So, try this:
Code:
function delayHideMenu(Layer1) {  settimeout("hideMenu([!]'[/!]Layer1[!]'[/!])",1000);  }

-kaht

Lisa, if you don't like your job you don't strike. You just go in every day and do it really half-assed. That's the American way. - Homer Simpson
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top