首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >TypeError: jQuery.easing[this.easing]不是函数

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

Stack Overflow用户
提问于 2014-01-30 14:37:59
回答 2查看 46.3K关注 0票数 7

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

此代码仅在1.10.2中有效

代码语言:javascript
复制
$(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中的工作:

代码语言:javascript
复制
$(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

我能做些什么来解决它呢?

EN

回答 2

Stack Overflow用户

发布于 2014-01-30 14:42:42

代码语言:javascript
复制
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中的这种方式

票数 1
EN

Stack Overflow用户

发布于 2014-09-16 19:45:26

您必须将Effects核心包含在jQuery UI下载构建器中才能解决此错误。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/21449489

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档