-2
time_60_mod
在下面的代碼中計數從0
無窮大。我試圖添加fadeIn
,fadeOut
它似乎並沒有工作。Jquery,Javascript fadeIn,fadeOut不工作
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<h1 id="the_numbers">0</h1>
<script>
var output = $('h1');
var isPaused = false;
var time = 0;
var t = window.setInterval(function() {
if(!isPaused) {
time++;
var time_60_mod = time % 60;
document.getElementById('the_numbers').innerHTML =
Math.floor(time/3600) % 24
+ ":" + Math.floor(time/60) % 60
+ ":" + time_60_mod.fadeOut(500);
time_60_mod.fadeIn(500);
}
}, 1000);
</script>
您究竟在做什麼? 'time_60_mod'是一個數字,沒有'fadeIn'或'fadeOut'方法...... – JCOC611