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 6 of 6
  1. #1
    New Coder
    Join Date
    Jun 2006
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts

    drop down menu upgrading

    Hello. I have a problem with upgrading a small drop-down-menu script which I have put here: http://paste.php.lv/3856. The problem is that when I get my mouse from the menu off, the sub-menus immediately dissapear, my question is this: how can I make the sub-menus stay 1 second after the mouse got from the sub-menu off.

  • #2
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,504
    Thanks
    3
    Thanked 501 Times in 488 Posts
    you link displays line numbers, this is a pain when copying

    post a link to the page or provide as simple text
    Vic

    God Loves You and will never love you less.

    http://www.vicsjavascripts.org/Home.htm

    If my post has been useful please donate to http://www.operationsmile.org.uk/

  • #3
    New Coder
    Join Date
    Jun 2006
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts

  • #4
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,504
    Thanks
    3
    Thanked 501 Times in 488 Posts
    Code:
     <script type="text/javascript">
    var sfEls;
     over = function() {
         sfEls = document.getElementById("primary-nav").getElementsByTagName("LI");
         for (var i=0; i<sfEls.length; i++) {
             sfEls[i].nu=i;
             sfEls[i].onmouseover=function() {
    for (var zxc0=0;zxc0<sfEls.length;zxc0++){
     if (sfEls[zxc0]!=this){
     //sfEls[zxc0].className=sfEls[zxc0].className.replace(new RegExp(" over\\b"), ""); // need to work on this
     }
    }             this.className+=" over";
             }
             sfEls[i].onmouseout=function() {
                   Hide(this);
              }
         }
     }
    
    function Hide(obj){
     zxcTO=setTimeout( function(){obj.className=obj.className.replace(new RegExp(" over\\b"), "");},1000);
    }
    
    
    if (window.attachEvent) window.attachEvent("onload", over);
     </script>
    Last edited by vwphillips; 06-03-2006 at 02:14 PM.
    Vic

    God Loves You and will never love you less.

    http://www.vicsjavascripts.org/Home.htm

    If my post has been useful please donate to http://www.operationsmile.org.uk/

  • #5
    New Coder
    Join Date
    Jun 2006
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I was thinking about something like that, but previously my codes didn't work (I'm just starter at JS) My next question is - maybe can give me a clue why does it work in IE but not in FF ?

  • #6
    New Coder
    Join Date
    Jun 2006
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Again a problem. http://www.lfka.lv/index2.htm see here when changing to other submenus faster than in 1 second, they just stay one on the other, how can I repair that?


  •  

    Posting Permissions

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