不知道爲什麼這是不工作,但我有它加載的數字像這樣一個計時器:淡入動態文本
function startTimer(num){
count = num;
countdown = setInterval(function(){
$("#timer p.seconds").text([count]).fadeIn(300);
count--;
}, 1000);
};
$(document).on('click', '.step3-btn', function(e){
e.preventDefault();
startTimer(30);
});
<p class="seconds"></p>
我想最初的數量慢慢淡出,但代碼不起作用。它只是顯示沒有褪色。
請張貼一個完整的代碼示例。 – j08691 2013-02-19 14:54:53
好吧,我剛剛添加了更多的代碼 – user1937021 2013-02-19 14:59:06
你有沒有試過在'.fadeIn(300)'之前放一個'.hide()'? '(「#timer p.seconds」)。text([count])。hide()。fadeIn(300);' – j08691 2013-02-19 15:06:10