2013年6月19日 星期三

解決fadeIn與fadeOut在mouseover與out的動作後會持續重複動畫

$(".navleng").mouseover(function() { //When trigger is clicked...
 
      $(this).find(".head_subnav").fadeIn(300).slideDown('fast'); //Drop down the subnav on click

      $(this).hover(function() {
      }, function(){
          $(this).find(".head_subnav").stop(true).fadeOut(300).slideUp('fast');
      });  
 
  });

在hover的相反裡加入.stop(true)即可,然後剛滑入時的fadeIn不要加。

沒有留言:

張貼留言