Xtremer360 Posted September 2, 2008 Share Posted September 2, 2008 I'm wanting to change the var delay hide from 500 to something like infinite so that my nav bar will when one of the menus is click the sub menus will stay up until another menu is selected. // Edit the dimensions of the below, plus background color--> print '<ilayer width=1010 height=20 name="dep1">'; print '<layer name="dep2" width=1010 height=20>'; print '</layer>'; print '</ilayer>'; print '<div id="describe" onClick="clear_delayhide()" onMouseout="resetit(event)"></div>'; ?> <script language="JavaScript1.2"> /* Tabs Menu (Click)- By Dynamic Drive For full source code and more DHTML scripts, visit http://www.dynamicdrive.com This credit MUST stay intact for use */ var submenu=new Array() //Set submenu contents. Expand as needed. For each content, make sure everything exists on ONE LINE. Otherwise, there will be JS errors. submenu[0]='<font size="2" face="Verdana"><b><a href="singles.php" target="main">Singles</a> | <a href="tagteams.php" target="main">Tag Team</a> | <a href="stables.php" target="main">Stables</a> | <a href="champions.php" target="main">Champions</a></b></font>' submenu[1]='<font size="2" face="Verdana"><b><a href="upcomingshow.php" target="main">Upcoming Show</a> | <a href="results.php" target="main">Recent Show Results</a> | <a href="showarchive.php" target="main">Show Archives</a> | <a href="tickets.php" target="main">Tickets</a></b></font>' submenu[2]='<font size="2" face="Verdana"><b><a href="photos.php" target="main">Show Photos</a> | <a href="kowphotos.php" target="main">KOW Photos</a> | <a href="http://profile.myspace.com/index.cfm?fuseaction=user.viewprofile&friendid=380983565">Myspace</a></b></font>' submenu[3]='<font size="2" face="Verdana"><b><a href="contact.php" target="main">Contact KOW</a> | <a href="titlehistory.php" target="main">History of Champions</a></b></font>' //Set delay before submenu disappears after mouse moves out of it (in milliseconds) var delay_hide=500 /////No need to edit beyond here var menuobj=document.getElementById? document.getElementById("describe") : document.all? document.all.describe : document.layers? document.dep1.document.dep2 : "" function showit(which){ clear_delayhide() thecontent=(which==-1)? "" : submenu[which] if (document.getElementById||document.all) menuobj.innerHTML=thecontent else if (document.layers){ menuobj.document.write(thecontent) menuobj.document.close() } } function resetit(e){ if (document.all&&!menuobj.contains(e.toElement)) delayhide=setTimeout("showit(-1)",delay_hide) else if (document.getElementById&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget)) delayhide=setTimeout("showit(-1)",delay_hide) } function clear_delayhide(){ if (window.delayhide) clearTimeout(delayhide) } function contains_ns6(a, b) { while (b.parentNode) if ((b = b.parentNode) == a) return true; return false; } </script> Quote Link to comment Share on other sites More sharing options...
Psycho Posted September 2, 2008 Share Posted September 2, 2008 No, you do not want to make the delay infinite. That will waste resources by the users computer to process that. Simply rewrite the code so there is NO delay and have the hide code take effect on an onclock event for another menu. Quote Link to comment Share on other sites More sharing options...
Xtremer360 Posted September 2, 2008 Author Share Posted September 2, 2008 I dont' know how to write javascript it was a script that I had found on dynamic drive or hotscripts I think. And don't know how to do that. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.