corr bug js
This commit is contained in:
parent
ba5256714b
commit
f19d1472bf
@ -33,6 +33,15 @@
|
||||
<script>
|
||||
var redirect;
|
||||
|
||||
function decompte(i) {
|
||||
//on affiche i secondes
|
||||
document.getElementById("decompte").innerHTML = i+" secondes";
|
||||
if (i == 0) {
|
||||
document.getElementById("decompte").innerHTML = "Redirection...";
|
||||
} // quand i atteint 0 on affiche redirection
|
||||
i -= 1; //on decremente
|
||||
}
|
||||
|
||||
function absorbEvent_(event) {
|
||||
var e = event || window.event;
|
||||
e.preventDefault && e.preventDefault();
|
||||
@ -47,22 +56,16 @@
|
||||
return false;
|
||||
});
|
||||
|
||||
function decompte(i)
|
||||
{
|
||||
document.getElementById("decompte").innerHTML = i+" secondes"; //on affiche i secondes
|
||||
if i == 0
|
||||
{ document.getElementById("decompte").innerHTML = "Redirection...";} // quand i atteint 0 on affiche redirection
|
||||
i -= 1; //on decremente
|
||||
}
|
||||
|
||||
|
||||
document.getElementById('imgRef').addEventListener("mousedown", function(event) {
|
||||
absorbEvent_(event);
|
||||
|
||||
var timer = setInterval("decompte()", 1000, 3); //intervalle, decompte de 1 secondes et indices 3 passé en parametres pour decompte
|
||||
redirect = setTimeout(function(){location.href="{{URL::to('choisirref')}}"}, 3000);
|
||||
return false;
|
||||
|
||||
});
|
||||
|
||||
document.getElementById('imgRef').addEventListener("mouseup", function() {
|
||||
clearTimeout(redirect);
|
||||
//clearInterval(timer); // on stop le decompte si on relache la souris
|
||||
|
Reference in New Issue
Block a user