Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

check if jQuery UI easing methods are available

I writing a plugin that does some toggling and I need a way to check what easing methods are available. I want to support the jQuery UI easing methods when available. It looks like those are in the effects package in the custom builder but, since that could be unchecked, it doesn't seem sufficient to check that jQuery UI is available. I want to check specifically that the easing methods are available.

like image 246
ryanve Avatar asked Feb 23 '23 01:02

ryanve


1 Answers

you can check it this way:

if ( $.easing && $.easing.easeInOutQuad ) {
    // Use easing function easeInOutQuad
} else {
    // Use some other stuff
}

See from line 597 in UI core (http://jqueryui.com/ui/jquery.effects.core.js) .

Link it broken but it should still work.

like image 147
Andreas Louv Avatar answered Mar 03 '23 20:03

Andreas Louv