2014-01-30 75 views
4

我需要添加一個效果,我的鏈接與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

我能做些什麼來解決它?

回答

1
a{ 
    color: #666; 
    -webkit-transition: all 0.3s ease-out; 
    -moz-transition: all 0.3s ease-out; 
    -o-transition: all 0.3s ease-out; 
    -ms-transition: all 0.3s ease-out; 
} 
a:hover{ 
    cursor: pointer; 
    color: #000; 
    text-decoration: none; 
} 

這樣在CSS

0

你必須包括影響核心在jQuery UI的下載生成器來解決這個錯誤。