1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| <script type='text/javascript'>
var running
var end =new Date(2012,11,12)
var day =1000*60*60*24
function launch(){
running=setInterval(function(){chrono()},1000);
}
function chrono(){
now=new Date()
diff=end.getTime() - now.getTime()
var remainingTime= new Date(diff);
if (diff==0){ clearTimeout(running);
alert("c'est la fin")
}
document.getElementById('clock').innerHTML=Math.floor(remainingTime.getTime()/day)+" jours : "+ remainingTime.getHours()+" heures : "+remainingTime.getMinutes()+" minutes : "+remainingTime.getSeconds()+" secondes";
}
</script>
</head>
<body onload="launch()">
<span id="clock"></span>  avant la fin du rouleau de papier Q.
</body>
</html> |