我使用http://tutorialzine.com/2011/12/countdown-jquery/這倒動畫的數量和褪色的不透明度爲0如何某一元素
編輯在關閉.animate()。新增的jsfiddle http://jsfiddle.net/Mw4j2/
// The .static class is added when the animation
// completes. This makes it run smoother.
digit
.before(replacement)
.removeClass('static')
.animate({opacity:0},'fast',function(){
digit.remove();
})
replacement
.delay(100)
.animate({top:0,opacity:1},'fast',function(){
replacement.addClass('static');
});
我在做不同的動畫的兩個實例在同一頁上的定時器,一個帶有動畫,一個沒有。難以理解如何僅關閉第二個示例(使用不同的類)的動畫效果。
這是什麼在dom準備初始化。
$('#countdown').countdown({
timestamp : ts,
callback : function(days, hours, minutes, seconds){
var message = "";
// message += days + " day" + (days==1 ? '':'s') + ", ";
message += hours + " hour" + (hours==1 ? '':'s') + ", ";
message += minutes + " minute" + (minutes==1 ? '':'s') + " and ";
message += seconds + " second" + (seconds==1 ? '':'s') + " <br />";
if(newYear){
message += "left until the new year!";
}
else {
message += "left to 10 days from now!";
}
note.html(message);
}
});
// Second Timer Example
$('.countdownSecond').countdown({
timestamp : ts,
callback : function(days, hours, minutes, seconds){
var message = "";
// message += days + " day" + (days==1 ? '':'s') + ", ";
message += hours + " hour" + (hours==1 ? '':'s') + ", ";
message += minutes + " minute" + (minutes==1 ? '':'s') + " and ";
message += seconds + " second" + (seconds==1 ? '':'s') + " <br />";
if(newYear){
message += "left until the new year!";
}
else {
message += "left to 10 days from now!";
}
note.html(message);
}
});
任何人都知道這是可能的嗎?
生病標記該所接受因爲它的工作原理:}謝謝! –