1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| <script type="text/javascript">
var temps = <?php echo $secondes;?>;
var timer =setInterval('CompteaRebour()',1000);
function CompteaRebour(){
temps-- ;
j = parseInt(temps) ;
h = parseInt(temps/3600) ;
m = parseInt((temps%3600)/60) ;
s = parseInt((temps%3600)%60) ;
document.getElementById('minutes').innerHTML= (h<10 ? "0"+h : h) + ' h : ' +
(m<10 ? "0"+m : m) + ' mn : ' +
(s<10 ? "0"+s : s) + ' s ';
if ((s == 0 && m ==0 && h ==0)) {
clearInterval(timer);
url = "<?php echo $redirection;?>"
Redirection(url)
}
}
function Redirection(url) {
window.setTimeout("window.location.reload(true)",500);
}
</script> |
Partager