2013-02-25 2 views
0

div가 처음 표시 될 때 div가 생겨 10 초 이상 느리게 페이드 아웃됩니다. 마우스가 다시 들어 오면 fadeto를 취소하고 (다시 진행 중이면) div를 다시 페이드해야합니다.jquery : cancel fadeto then fadein

.stop()은 여기 내 구세주입니다. 그것은 제대로 사업부의 fadeTo을 중지하지만 내 인생 내가 fadeIn 걷어차 얻을 수 없습니다

다음

내가 무슨이다.

$(document).on('mouseenter', '#player', function(){ 
     $(this).stop().fadeIn('fast'); 
    }); 

    $(document).on('mouseleave', '#player', function(){ 
     $(this).stop().fadeTo(10000,0.2); 
    }); 

http://jsfiddle.net/FraserHart/SMQ4M/

답변

1

내가 그것을했다. http://jsfiddle.net/ -

$(document).on('mouseenter', '#player', function(){ 
     $(this).stop().fadeTo('fast',1); 
    }); 

    $(document).on('mouseleave', '#player', function(){ 
     $(this).stop().fadeTo(10000,0.2); 
    }); 
+0

예 :

내가 fadeTo와 페이드 아웃 때와 같이 다시 fadeTo보다는 fadeIn와 페이드 필요, 그것은 단지 불투명도 그래서 여전히 볼을 처리 조정 SMQ4M/2 / –