带有缓动的jQuery slideDown [英] jQuery slideDown with easing
本文介绍了带有缓动的jQuery slideDown的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用slideDown()函数进行缓动?
How can use the slideDown() function with easing?
可能以某种方式扩展它?
Maybe extend it somehow?
I我正在寻找这样的东西:
I'm looking for something like this:
jQuery.fn.slideDown = function(speed, easing, callback) {
return ...
};
所以我可以用它滑动这个
So i can use it slide this
$('.class').slideDown('400','easeInQuad');
或者这个
or this
$('.class').slideDown('400','easeInQuad',function(){
//callback
});
推荐答案
查看此页面,其中包含许多缓动功能: http://gsgd.co.uk/sandbox/jquery/easing/
Take a look at this page, which contains many easing functions: http://gsgd.co.uk/sandbox/jquery/easing/
使用该插件可以执行以下操作:
Using that plugin you can do things like:
$(element).slideUp({
duration: 1000,
easing: method,
complete: callback});
这篇关于带有缓动的jQuery slideDown的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文