开发者

How to check that a jQuery easing method is defined

How can I check to see that a specific easing method is defined? For example, jQuery includes two methods ("linear" and "swing"), jQuery UI has a bunch more and there are also third-party plugins that have even more methods. In my plugin, I let developers specify an easing method but it is up to them to include the proper files which define those methods, so I want to check and display an error if they have specified 开发者_如何转开发an easing method which does not exist.


I believe it should be as easy as:

jQuery.easing['swing'] != undefined    // -> true
jQuery.easing['foobar'] != undefined   // -> false
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜