0

I'd like to ask if there's a proper way of avoiding 'mouseenter mouseleave' function for/to wobble the element selected?

this code came from jquery and it is working properly but when you hover mistakenly many times the navigation, it wobble the hidden elements when your mouse is already over to the element.

      $('#mn_learn').bind('mouseenter mouseleave', function(){
    $('.toggleLearn').slideToggle('250');
  });

i did tried to check on how to avoid that but im not lucky to do that. advance thanks for the help. check the sample here...

iMarkDesigns
  • 1,200
  • 2
  • 14
  • 32

1 Answers1

2

jQuery queues every animation that you are attempting to do in order to not mistakenly run two at the same time, in order to prevent animation overload, you need to clear the current object's queue using jQuery.stop(1,1).

$('#mn_learn').bind('mouseenter mouseleave', function(){
    $('.toggleLearn').stop(1,1).slideToggle('250');
});
Korvin Szanto
  • 4,531
  • 4
  • 19
  • 49