ページを自動的にスクロールし、ユーザーがページを操作するとアニメーションを停止するこのコードがあります。これはデスクトップ デバイスでは適切に機能しますが、iPhone では機能しません。ユーザーが指でページをスクロールしようとすると、アニメーションはページの下部に到達するまで停止しません。これには何ができますか?ありがとう!
$("html,body").stop().animate({scrollTop: $(document).height()}, 2000);
// Stop the animation if the user scrolls. Defaults on .stop() should be fine
$("body,html").bind("scroll mousedown DOMMouseScroll mousewheel keyup", function(e){
$("html,body").stop();
});