Redirection après un compte à rebour
BrietGameYT
Messages postés
2
Date d'inscription
Statut
Membre
Dernière intervention
-
jordane45 Messages postés 38486 Date d'inscription Statut Modérateur Dernière intervention -
jordane45 Messages postés 38486 Date d'inscription Statut Modérateur Dernière intervention -
Bonjour, j'ai grâce à ce code, un compte à rebour qui varie selon une date donnée. J'aimerais bien comprendre comme faire une redirection dès que le compte à rebour arrive à 0.
Voici le code JS :
EDIT : Ajout des balises de code
Merci d'avance :)
Voici le code JS :
$(window).load(function(){ $('.preloader').fadeOut('slow'); }); /* =Main INIT Function -------------------------------------------------------------- */ function initializeSite() { "use strict"; //OUTLINE DIMENSION AND CENTER (function() { function centerInit(){ var sphereContent = $('.sphere'), sphereHeight = sphereContent.height(), parentHeight = $(window).height(), topMargin = (parentHeight - sphereHeight) / 2; sphereContent.css({ "margin-top" : topMargin+"px" }); var heroContent = $('.hero'), heroHeight = heroContent.height(), heroTopMargin = (parentHeight - heroHeight) / 2; heroContent.css({ "margin-top" : heroTopMargin+"px" }); } $(document).ready(centerInit); $(window).resize(centerInit); })(); // Init effect $('#scene').parallax(); }; /* END ------------------------------------------------------- */ /* =Document Ready Trigger -------------------------------------------------------------- */ $(window).load(function(){ initializeSite(); (function() { setTimeout(function(){window.scrollTo(0,0);},0); } })(); }); /* END ------------------------------------------------------- */ $('#countdown').countdown({ date: "March 28, 2019 21:00:00", render: function(data) { var el = $(this.el); window.location.replace("https://monsite.fr/"); el.empty() //.append("<div>" + this.leadingZeros(data.years, 4) + "<span>years</span></div>") .append("<div>" + this.leadingZeros(data.days, 2) + " <span>days</span></div>") .append("<div>" + this.leadingZeros(data.hours, 2) + " <span>hrs</span></div>") .append("<div>" + this.leadingZeros(data.min, 2) + " <span>min</span></div>") .append("<div>" + this.leadingZeros(data.sec, 2) + " <span>sec</span></div>"); } });
EDIT : Ajout des balises de code
Merci d'avance :)
A voir également:
- Redirection après un compte à rebour
- Créer un compte google - Guide
- Créer un compte gmail - Guide
- Créer un compte instagram sur google - Guide
- Facebook se connecter à un autre compte - Guide
- Installer windows 10 sans compte microsoft - Guide
Je regarde pourtant cette documentation officiel et je ne vois rien du tout qui va m'aider.
http://hilios.github.io/jQuery.countdown/documentation.html
Et aussi window.location.replace() qui est une méthode de String et non de window.location , ça ne serais pas plutôt window.location.href = nouvelURL !