jQuery.easing 中的 Object #<Object> has no method 'swing'

项目中添加了两个jquery插件,lava_lamp 和 jcarousel,结果这两种效果之间有冲突,主要是 对于 自定义 easing 插件的效果兼容问题,

在lava_lamp的easing插件中 直接定义了jQuery.easing={/*自定义的jQuery.easing效果*/},以至于跟 jcarousel冲突,显示  Object #<Object> has no method 'swing' 的冲突,

度娘了下,找到如下解决方案:

//使用这种方法自定义jQuery.easing
jQuery.extend(jQuery.easing,{/*自定义的jQuery.easing效果*/});
//不要这样重写jQuery.easing效果,要不会出错,找不到效果插件,除非自定的jQuery.easing中有swing和linear这2种效果
jQuery.easing={/*自定义的jQuery.easing效果*/};

 因为jquery默认提供swing和linear 2种擦除效果动画插件,jquery的slideUp和 slideDown和fadeIn/fadeOut这种默认要使用到swing效果或者linear,所以直接定义jQuery.easing时如果不存在swing和linear,调用效果方法slideUp等就会报错找不到swing或linear檫除效果。

 

转自 http://www.coding123.net/article/20121110/self-define-jQuery.easing-plugin-note.aspx

posted on 2013-07-09 15:14  鱼咸  阅读(395)  评论(0编辑  收藏  举报