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