我需要添加一個效果,我的鏈接與jQuery,但它只適用於最小1.7.1,我有另一個代碼,只能在1.10.2 。TypeError:jQuery.easing [this.easing]不是一個函數
此代碼只能在1.10.2
$(document).ready(function(){
var menu = document.querySelector('#menu-bar-wrapper');
var origOffsetY = menu.offsetTop;
function scroll() {
if ($(window).scrollTop() >= origOffsetY) {
$('#menu-bar-wrapper').addClass('sticky');
$('#latest-wrapper').addClass('menu-padding');
} else {
$('#menu-bar-wrapper').removeClass('sticky');
$('#latest-wrapper').removeClass('menu-padding');
}
}
document.onscroll = scroll;
});
這項工作在1.7.1:
當我打開我的網站,這兩個代碼不工作,告訴我這錯誤:
TypeError: jQuery.easing[this.easing] is not a function
percent, this.options.duration * percent, 0, 1, this.options.duration
我能做些什麼來解決它?