TypeError:jQuery.easing [this.easing]不是一个函数



我需要在与jQuery的链接中添加效果,但它仅在min 1.7.1中起作用,而且我还有另一个代码,仅在1.10.2中起作用。

此代码仅在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的这项工作:

$(document).ready(function(){
    $('.block-content ul.menu li').hover(function(event) {
        $(this).stop().animate({ marginRight: "5px" }, {duration: 'slow',easing: 'easeOutElastic'});
    },function(){
        $(this).stop().animate({ marginRight: "0px" }, {duration: 'slow',easing: 'easeOutElastic'});
    });
});

打开网站时,这两个代码不起作用,并向我展示此错误:

TypeError: jQuery.easing[this.easing] is not a function

percent, this.options.duration * percent, 0, 1, this.options.duration

我该怎么办?

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

中以这种方式

您必须在jQuery UI下载构建器中包含效果core 才能解决此错误。

最新更新