2017-10-05 1 views
0

내가 너무 내 사업부를 통해 드래그 할 때 페이지를 아래로 스크롤하려면,스크롤 애니메이션이 멈추지 않습니까?

내가 스크롤 애니메이션을 설정,하지만 난 그 DIV 나갈 때, 그것의, 스크롤을 계속하고 이상 드래그에서
$('#scroll-handle-down').on('dragover', function() { 

    console.log('we hovered'); 
    $('html, body').animate({ 
     scrollTop: height 
    }, 10000); 
}); 
$('#scroll-handle-down').on('dragleave', function() { 
    console.log("left") 
    $('html, body').stop().animate(); 
}); 

특정 div를 넘지 않았을 때 스크롤을 멈추고 싶습니다.

dragleave 이벤트에서 스크롤 애니메이션을 어떻게 멈출 수 있습니까?

답변

0

사용

$('html, body').stop(); 

또는

$('html, body').animate().stop(); 
관련 문제