我想在我的平滑滾動代碼中添加緩動樣式,但每當我這樣做時,它都會在控制檯中引發持續增加的jquery錯誤。在轉換時添加緩動拋出jquery錯誤
$('#slider-scrollDown').click(function() {
$('html, body').animate({
scrollTop: $("#scrollTo-container").offset().top
}, 2000);
});
這是我應得的,我嘗試添加像這樣的寬鬆政策:
$('#slider-scrollDown').click(function() {
$('html, body').animate({
scrollTop: $("#scrollTo-container").offset().top
}, 2000, 'easeInOut');
});
的錯誤,我收到的控制檯是:
Uncaught TypeError: n.easing[this.easing] is not a function
該款顯示器一次,然後在下面的另一個紅色增加的數字,它不停止。
刪除時間延遲和寫easeInOutCubic –
好吧,但這不是真的那種寬鬆我想用... – Lee
請檢查此答案http://stackoverflow.com/questions/12592279/typeerror-p-easingthis- easing-is-not-a-function –