I have a dropmenu which is shown and hidden (slideUp and slideDown) when hovering over an element using jquery...
$("#element").hover( function() {
$(this).next().clearQueue();
$(this).next().slideDown(); //animate({height:300},100);
}, function() {
if (!$(this).next().is(':hover')) {
$(this).next().clearQueue();
$(this).next().slideUp(); //animate({height:0},100);
}
});
I initially didn't include the line clearQueue() but this caused the slideUp/Down to queue and animate for a long time if the user erratically hovers over and out of #element.
Adding that line means that the dropdown does not fully appear if the user hovers and over and out really quickly.
I can get around this by animating the slideDown but the trouble is I don't know the exact height I need to animate to because it can change.
Is there anyway to stop this behaviour?