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
    New to the CF scene
    Join Date
    Aug 2012
    Posts
    7
    Thanks
    4
    Thanked 0 Times in 0 Posts

    hovering quickly over menu glitches, jquery

    hi all,

    I made a dropdown menu with 2 submenu's that works properly. http://edumasy.nl/ba.html
    When i quickly hover over main2 (see link) the menu stops the show the second sub items under sub21 and sub22.
    Is there a way to fix this?
    The jquery im using:

    Code:
        $('#menu li').mouseenter(
            function () {
                //show its submenu
                $('ul:first', this).stop().slideDown(500);
            });
        
    
    	$('#menu li').mouseleave(
            function () {
                //hide its submenu
                $('ul', this).stop().slideUp(500);          
            }
        );
    thanks in advance

  • #2
    Senior Coder
    Join Date
    Dec 2010
    Posts
    2,355
    Thanks
    11
    Thanked 558 Times in 551 Posts
    Always use .stop() with appropriate parameters
    Code:
        $('#menu li').mouseenter(
            function () {
                //show its submenu
                $('ul:first', this).stop(true, true).slideDown(500);
            });
        
    
    	$('#menu li').mouseleave(
            function () {
                //hide its submenu
                $('ul', this).stop(true, true).slideUp(500);          
            }
        );

  • Users who have thanked devnull69 for this post:

    chiv (08-24-2012)


  •  

    Posting Permissions

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