Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在编写一个插件,我需要检测缓动是否可用,因为引用一个不会导致插件失败的缓动。
如果宽松不存在,我将回退到swing.
swing
那么,我该如何弄清楚呢?
jQuery.easing有他们。
jQuery.easing
if ('easeOutBounce' in jQuery.easing) { // Good to go }
$(this).animate( { bottom: 0 }, { duration: 100, easing: 'easeOutCubic' in $.easing ? 'easeOutCubic' : 'swing' } );