Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

set jquery default animation speed

Tags:

jquery

I cannot find any documentation. All I want to do it set jQuerys default animation speed. Something like this:

 $.setDefaultAnimationSpeed = 5000; //does not work

 $('elem').fadeIn(); // takes 5 seconds
 $('elem').animate({
     foo : bar
 }); // also takes 5 seconds

Thanks folks!

like image 500
Fresheyeball Avatar asked Feb 13 '12 05:02

Fresheyeball


1 Answers

$.fx.speeds._default = 1000; // change to whatever your desired speed

or

$.fx.speeds.jojo = 1000; // adds your own speed object to jqueryspeed

Reference: https://learn.jquery.com/effects/intro-to-effects/#jquery-fx

like image 109
jojo Avatar answered Oct 14 '22 00:10

jojo