设置jQuery默认动画速度 [英] set jquery default animation speed
本文介绍了设置jQuery默认动画速度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我找不到任何文档.我要做的就是设置jQuerys的默认动画速度.像这样:
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
谢谢大家!
推荐答案
$.fx.speeds._default = 1000; // change to whatever your desired speed
或
$.fx.speeds.jojo = 1000; // adds your own speed object to jqueryspeed
参考: https://learn.jquery.com/effects /intro-to-effects/#jquery-fx
这篇关于设置jQuery默认动画速度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文