Compte a Rebours

Statut
N'est pas ouverte pour d'autres réponses.

SamirMG

Développeur sous android , ios et web
Premium
Inscription
20 Novembre 2012
Messages
5 304
Réactions
1 033
Points
14 029
RGCoins
25
Bonjour à tous

Voici un script pour mettre un compte a rebours sur votre forum. (il en existe d'autres)


Code:
<label id="Compte"></label>
<script type="text/JavaScript">

var Affiche=document.getElementById("Compte");
function Rebour() {
var date1 = new Date();
var date2 = new Date ("Jan 1 00:00:00 2015"); /*Date a modifier ici*/
var sec = (date2 - date1) / 1000;
var n = 24 * 3600;
if (sec > 0) {
j = Math.floor (sec / n);
h = Math.floor ((sec - (j * n)) / 3600);
mn = Math.floor ((sec - ((j * n + h * 3600))) / 60);
sec = Math.floor (sec - ((j * n + h * 3600 + mn * 60)));
Affiche.innerHTML = "Temps restant avant le 01/01/2015: " + j +" j "+ h +" h "+ mn +" min "+ sec + " s ";
window.status = "Temps restant avant: " + j +" j "+ h +" h "+ mn +" min "+ sec + " s ";
}
tRebour=setTimeout ("Rebour();", 1000);
}
Rebour();
</script>

Pour Xenforo
J'ai placé le code dans le template PAGE_CONTAINER après

Code:
Code:
<xen:hook name="page_container_content_title_bar">
<xen:if is="!{$noH1}">

source:blackmania
 
Tutoriel C/c d'un autre forum ...
 
C'est quoi le problème a jamais citer la source ?
 
elle y est :rofl:
 
Statut
N'est pas ouverte pour d'autres réponses.
Retour
Haut