开发者

How to check that a jQuery easing method is defined

开发者 https://www.devze.com 2023-03-16 11:00 出处:网络
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 t

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

精彩评论

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