0
我想知道是否有任何方法来使这个插件:http://www.thewebsqueeze.com/web-design-tutorials/sequential-fade-in-jquery-plug-in.html显示顶部项目的淡入淡出?jQuery - 颠倒sequental淡入插件
非常感谢!
我想知道是否有任何方法来使这个插件:http://www.thewebsqueeze.com/web-design-tutorials/sequential-fade-in-jquery-plug-in.html显示顶部项目的淡入淡出?jQuery - 颠倒sequental淡入插件
非常感谢!
可以逆转扭转阵列顺序.each()
电话,和其他一些优化,比如:
(function($) {
$.fn.fadeInSequence = function(fadeInTime, timeBetween) {
//Default Values
timeBetween = timeBetween || 0;
fadeInTime = fadeInTime || 500;
//The amount of remaining time until the animation is complete.
//Initially set to the value of the entire animation duration.
var l = this.length, remainingTime = l * (fadeInTime+timeBetween);
$.each(this.get().reverse(), function(i) {
//Wait until previous element has finished fading and timeBetween has elapsed
$(this).delay(i*(fadeInTime+timeBetween));
//Decrement remainingTime
remainingTime -= (fadeInTime+timeBetween);
if($(this).css('display') == 'none')
{
$(this).fadeIn(fadeInTime);
}
else //If hidden by other means such as opacity: 0
{
$(this).animate({'opacity' : 1}, fadeInTime);
}
//Delay until the animation is over to fill up the queue.
$(this).delay(remainingTime+timeBetween);
});
return this;
};
})(jQuery);
Here's a copy the demo page updated to use the backwards version。
谢谢,非常简单的解决方案! – c4rrt3r 2010-09-07 14:58:18
请问您能解释一些,你打算做什么? – simplyharsh 2010-09-07 13:51:38
你是说从顶端?不清楚你的意思是“顶部的项目淡入淡出” – 2010-09-07 13:52:46