fix the jquery multiple hover animations

阅读更多
1. use hover or mouseenter + mouseleave

2. use stop(true, true) to Stop the currently-running animation on the matched elements. (.stop( [clearQueue] [, jumpToEnd] ))


$(document).ready(function(){
  
  $('li.mainlevel').hover(function(){
      $(this).find('ul').stop(true, true).slideDown();//you can give it a speed
  }, function(){
      $(this).find('ul').stop(true, true).slideUp();
  });
  
});

你可能感兴趣的:(fix the jquery multiple hover animations)