ドキュメント head> 01 : 01 : 59<br> var getHour = $('#hour').text(); <br>var getMin = $('#分').text();<br>var getSec = $('#秒').text();<br>setInterval(function() {<br> var allTime = parseInt(getSec) + parseInt( getMin * 60) + parseInt(getHour * 3600);<br> allTime--;<br> if (getSec > 0) {<br> getSec--;<br> if (getSec getSec = '0' + getSec;<br> // console.log(getSec)<br> }<br> $('#second').html(getSec)<br> } else {<br> getSec = 59;<br> }<br> if (allTime % 60 == 0) {<br> getMin--; <br> // console.log(getMin)<br> if (getMin >= 0) {<br> if (getMin < 10) {<br/> getMin = '0' + getMin;<br/> }<br/> $('# minutes').html(getMin)<br/> } else {<br/> getMin = 30 ;<br/> $('# minutes').html(getMin)<br/> }<br/> }<br/> if (allTime % 3600 == 0) {<br/> getHour--;<br/> if (getHour >= 0) {<br> if (getHour getHour = '0' + getHour;<br> }<br> $('#hour').html(getHour)<br> } else {<br> getHour = 30;<br> $('#hour').html(getHour)<br> }<br> }<br>}, 1)<br>