0

我正在编写一个插件,我需要检测缓动是否可用,因为引用一个不会导致插件失败的缓动。

如果宽松不存在,我将回退到swing.

那么,我该如何弄清楚呢?

4

1 回答 1

4

jQuery.easing有他们。

if ('easeOutBounce' in jQuery.easing) {
  // Good to go
}

例子

$(this).animate(
    {
         bottom: 0
    },
    {
         duration: 100,
         easing: 'easeOutCubic' in $.easing ? 'easeOutCubic' : 'swing'
    }
);
于 2011-03-11T08:02:13.887 回答