Mohammed Hanafy
Mohammed Hanafy

Reputation: 433

Issue regarding JQuery Sliding SubMenu and repeated animations

That link got the same problem as the one I'm having: issue regarding dropdown menu

This is my code

$("document").ready(function() {
   menuFunc (); 
});
function menuFunc (){
    $('#nav').on('mouseenter mouseleave','li',function (){
            $(this)
                .removeClass('noJS')
                .children('ul')
                    .slideToggle(200);
            });
    };

How and where to use the .stop() to fix this issue?

Upvotes: 0

Views: 37

Answers (1)

Anoop Joshi P
Anoop Joshi P

Reputation: 25527

Try like this

function menuFunc (){
$('#nav').on('mouseenter mouseleave','li',function (){
        $(this)
            .removeClass('noJS')
            .children('ul').stop()
                .slideToggle(200);
        });
};

Upvotes: 1

Related Questions