jquery-Slide Effect not consistent and happening too many times with jquery 1.7


The code that worked :

$(document).ready(function() {
    $(".menuList li").mouseenter( function() {
        $(this).find(".submenuInner").stop(true, true).css({"margin-top":"0"});
        $(this).children(".submenu").stop(true, true).slideDown("slow");
    });

    //console.log("menuin");

    $(".menuList li").mouseleave( function() {
        $(this).children(".submenu").stop(true, true).slideUp("slow");
        //$(this).find(".submenuInner").animate({marginTop:"-100%"},{queue :false,duration :50});
        $(this).find(".submenuInner").stop(true, true).animate({marginTop:"-100%"},500);
    });
});

The code that didn't work :


$(document).ready(function() {
$(".menuList li").mouseenter( function() {
        $(this).find(".submenuInner").stop().css({"margin-top":"0"});
    $(this).children(".submenu").slideDown("slow");
    });

    //console.log("menuin");

    $(".menuList li").mouseleave( function() {
        $(this).children(".submenu").slideUp("slow");
        //$(this).find(".submenuInner").animate({marginTop:"-100%"},{queue :false,duration :50});
        $(this).find(".submenuInner").animate({marginTop:"-100%"},500);
    });
});

Tagged with: ,
Posted in Jquery

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow me on Twitter

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 442 other followers

%d bloggers like this: