ccc
This commit is contained in:
parent
f19d1472bf
commit
cc7f40582d
@ -32,14 +32,15 @@
|
|||||||
@section('page-scripts')
|
@section('page-scripts')
|
||||||
<script>
|
<script>
|
||||||
var redirect;
|
var redirect;
|
||||||
|
var i = 3;
|
||||||
|
|
||||||
function decompte(i) {
|
function decompte() {
|
||||||
//on affiche i secondes
|
//on affiche i secondes
|
||||||
document.getElementById("decompte").innerHTML = i+" secondes";
|
document.getElementById("decompte").innerHTML = i.toString()+" secondes";
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
document.getElementById("decompte").innerHTML = "Redirection...";
|
document.getElementById("decompte").innerHTML = "Redirection...";
|
||||||
} // quand i atteint 0 on affiche redirection
|
} // quand i atteint 0 on affiche redirection
|
||||||
i -= 1; //on decremente
|
i = i - 1; //on decremente
|
||||||
}
|
}
|
||||||
|
|
||||||
function absorbEvent_(event) {
|
function absorbEvent_(event) {
|
||||||
@ -60,7 +61,7 @@
|
|||||||
|
|
||||||
document.getElementById('imgRef').addEventListener("mousedown", function(event) {
|
document.getElementById('imgRef').addEventListener("mousedown", function(event) {
|
||||||
absorbEvent_(event);
|
absorbEvent_(event);
|
||||||
var timer = setInterval("decompte()", 1000, 3); //intervalle, decompte de 1 secondes et indices 3 passé en parametres pour decompte
|
var 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;
|
||||||
|
|
||||||
@ -68,7 +69,7 @@
|
|||||||
|
|
||||||
document.getElementById('imgRef').addEventListener("mouseup", function() {
|
document.getElementById('imgRef').addEventListener("mouseup", function() {
|
||||||
clearTimeout(redirect);
|
clearTimeout(redirect);
|
||||||
//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