Anyone can help me? I want a dropdown menu with animation on mouseenter and mouseleave events but when clicked after mouse enter I want the submenu stay visible until new click anywhere in page (in the example is only in the body). After that second click (same animation of mouseleave) I want mouseenter and mouseleave .on again like when we started.
$('#menu > li').on('mouseenter',function(){
//mouseenter handler
});
$('#menu > li').on('mouseleave',function(){
//mouseleave handler
});
$('#menu > li').toggle(
function () {
$('#menu > li').off('mouseenter mouseleave');
},
function () {
//mouseleave handler
});
$('body').click(function(){
//same mouseleave handler
});
I don't know how i can enable mouseenter/mouseleave after second click. Sorry, and thanks.