Version compl�te: jsB@nk » Heure » Compteur » Event Countdown script
URL: https://www.javascriptbank.com/event-countdown-script.html
Un simple d'utilisation à rebours de script qui peut aussi compter pour un montant spécifique de jours (par exemple, le jour 12 de 30). (Complément d'utilisations énumérées dans le script).
Version compl�te: jsB@nk » Heure » Compteur » Event Countdown script
URL: https://www.javascriptbank.com/event-countdown-script.html
<script language="javascript"><!--/*Created by: James Crooke :: http://www.cj-design.com** Additional formats can be seen on the Web site at:http://www.cj-design.com/demos/cjeventcountdownv1/ */function renderMessage(dateStr, msg1, msg2, countFrom) { var date = new Date(dateStr); var now = new Date(); var diff = date.getTime() - now.getTime(); var days = Math.floor(diff / (1000 * 60 * 60 * 24)) + 1; if(days < 1) { document.write(msg1); } else { if(countFrom) days = countFrom - days; document.write(msg2.replace(/%days%/g, number_format(days))); }}function number_format(num) { num = num.toString().replace(/\$|\,/g,''); if(isNaN(num)) { num = "0"; } sign = (num == (num = Math.abs(num))); num = Math.floor(num*100+0.50000000001); num = Math.floor(num/100).toString(); for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++) num = num.substring(0,num.length-(4*i+3))+','+ num.substring(num.length-(4*i+3)); return (((sign)?'':'-') + num);}// --></script><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->
<script type="text/javascript"><!-- // 1st parameter: "target date", 2nd parameter: "late message", 3rd parameter: "early message". renderMessage("December 11, 2008", "You missed it!!", "Hurry, there's only %days% days to go!");//--></script></blockquote><p>In this example, the date is set to <strong>November 15, 2005</strong>, a date which has passed...</p><blockquote><script type="text/javascript"><!-- renderMessage("November 15, 2005", "You missed it!", "Hurry, there's only %days% days to go!");//--></script><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->