I have the following code:
$(".nav_button").hover(function(){
m = $(this).children("ul").css("display");
if (m == "none"){
$(this).children("ul").slideDown(300);
}
else{
$(this).children("ul").slideUp(300);
}
});
And alot of times it gets bugged, sometimes it slides, stays, etc.
Any idea why is that and how to correct it?
Use this one instead to get rid of checks and other non-related code
This will automatically slideUp or slideDown your UL according to the current state.
this is from official jQuery documentation: