correction affichage + bug compteur
This commit is contained in:
parent
87d494023f
commit
5ebd4a3831
@ -33,10 +33,10 @@
|
|||||||
<script>
|
<script>
|
||||||
var redirect;
|
var redirect;
|
||||||
var i = 3;
|
var i = 3;
|
||||||
|
var timer = null;
|
||||||
function decompte() {
|
function decompte() {
|
||||||
//on affiche i secondes
|
//on affiche i secondes
|
||||||
document.getElementById("decompte").innerHTML = i.toString()+" secondes";
|
document.getElementById("decompte").innerHTML ="Redirection dans : "+i.toString()+" secondes";
|
||||||
if (i == 0)
|
if (i == 0)
|
||||||
{
|
{
|
||||||
document.getElementById("decompte").innerHTML = "Redirection..."; // quand i atteint 0 on affiche redirection
|
document.getElementById("decompte").innerHTML = "Redirection..."; // quand i atteint 0 on affiche redirection
|
||||||
@ -64,7 +64,7 @@
|
|||||||
|
|
||||||
document.getElementById('imgRef').addEventListener("mousedown", function(event) {
|
document.getElementById('imgRef').addEventListener("mousedown", function(event) {
|
||||||
absorbEvent_(event);
|
absorbEvent_(event);
|
||||||
var timer = setInterval(function(){ decompte() } , 1000); //intervalle, decompte de 1 secondes
|
timer = setInterval(function(){ decompte() } , 1000); //intervalle, decompte de 1 secondes
|
||||||
//redirect = setTimeout(function(){location.href="{{URL::to('choisirref')}}"}, 3000);
|
//redirect = setTimeout(function(){location.href="{{URL::to('choisirref')}}"}, 3000);
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -72,6 +72,8 @@
|
|||||||
|
|
||||||
document.getElementById('imgRef').addEventListener("mouseup", function() {
|
document.getElementById('imgRef').addEventListener("mouseup", function() {
|
||||||
clearTimeout(redirect);
|
clearTimeout(redirect);
|
||||||
|
document.getElementById("decompte").innerHTML =""; //on efface le contenu
|
||||||
|
i = 3; //on reset le compteur
|
||||||
clearInterval(timer); // on stop le decompte si on relache la souris
|
clearInterval(timer); // on stop le decompte si on relache la souris
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user