zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    for循环
    条件语句练习
    语句
    语言基础
    python -- 异步IO 协程
    转--python -- 收发邮件
    hive vs hbase
    postgresql 常用速查
    转--利用hexo搭建个人静态博客
    转- --python 3 编码
  • 原文地址:https://www.cnblogs.com/reddptp/p/3180022.html
Copyright © 2011-2022 走看看