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

  • 相关阅读:
    React网络请求fetch之get请求
    英语学习
    人物传记
    四月
    启程
    情绪
    办公新址
    孩子大了
    幸福的生日
    hibernate---树状映射
  • 原文地址:https://www.cnblogs.com/reddptp/p/3180022.html
Copyright © 2011-2022 走看看