Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jun 2008
    Posts
    682
    Thanks
    114
    Thanked 2 Times in 2 Posts

    Changing the Var Delay Hide (JavaScript Code)

    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.

    Code:
    // 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>

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,308
    Thanks
    203
    Thanked 2,563 Times in 2,541 Posts
    var delay_hide=500

    500 milliseconds = half a second.

    86400000 milliseconds = one day (24 hours).


    The older I grow the more I distrust the familiar doctrine that age brings wisdom.
    H.L. Mencken 1880-1956, American Editor, Author, Critic, Humorist


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •