Countdown Timer 2

JavaScriptBank

Bannato
26 Nov 2009
86
0
0
This countdown script prints directly to the page, displaying the time left in minutes and seconds. The time duration can be set in the ... detail at JavaScriptBank.com - 2.000+ free JavaScript codes


How to setup

Step 1: CSS below for styling thescript, place it into HEAD section
CSS
Codice:
<style>
.timeClass {
  font-family:arial,verdana,helvetica,sans-serif;
  font-weight:normal;
  font-size:10pt;
}
</style>
	<!--
    	This script downloaded from www.JavaScriptBank.com
    	Come to view and download over 2000+ free javascript at www.JavaScriptBank.com
	-->

Step 2: Copy & Paste JavaScript code below in your HEAD section
JavaScript
Codice:
<script>
/*
	Created by: Sandeep Gangadharan 
	Web Site: http://www.sivamdesign.com/
*/

var sec = 30;   // set the seconds
var min = 02;   // set the minutes

function countDown() {
  sec--;
  if (sec == -01) {
    sec = 59;
    min = min - 1;
  } else {
   min = min;
  }
if (sec<=9) { sec = "0" + sec; }
  time = (min<=9 ? "0" + min : min) + " min and " + sec + " sec ";
if (document.getElementById) { theTime.innerHTML = time; }
  SD=window.setTimeout("countDown();", 1000);
if (min == '00' && sec == '00') { sec = "00"; window.clearTimeout(SD); }
}

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

addLoadEvent(function() {
  countDown();
});

</script>
	<!--
    	This script downloaded from www.JavaScriptBank.com
    	Come to view and download over 2000+ free javascript at www.JavaScriptBank.com
	-->

Step 3: Copy & Paste HTML code below in your BODY section
HTML
Codice:
<span id="theTime" class="timeClass"></span>
	<!--
    	This script downloaded from www.JavaScriptBank.com
    	Come to view and download over 2000+ free javascript at www.JavaScriptBank.com
	-->






 
Discussioni simili
Autore Titolo Forum Risposte Data
F Countdown / timer javascript Javascript 19
J Make a JavaScript Countdown Timer in OOP Javascript 0
J JavaScript Countdown Timer solution in OOP Javascript 0
L countdown multiplo javascript Javascript 1
M Come fare un countdown in HTML? HTML e CSS 4
L Creare un countdown con giorno specifico della settimana PHP 3
T countdown da sistemare con i CSS... HTML e CSS 4
C Countdown bloccato? Javascript? Javascript 0
D [Javascript] [HTML] Countdown su Mobirise di 24 ore relative per ogni utente. Javascript 4
Alex1990000 [PHP] countdown 6 ore data PHP 9
Michaelweb93 [PHP] Creazione countdown a 72 ore PHP 1
G Countdown in secondi JS su pagina PHP Javascript 1
N Creazione countdown PHP 4
A Countdown js con variabile in php Javascript 16
A countdown modificabile con un click Javascript 1
O Countdown jQuery jQuery 0
O Countdown jQuery Javascript 1
P countdown jquery jQuery 2
blips Countdown e Redirect Javascript 3
T Javascript e countdown multipli Javascript 1
T Countdown e timestamp PHP 0
S countdown in php e script per aprire 2 siti contemporanemante PHP 1
P problema con il countdown per la fine dell'anno e per natale Javascript 13
N Countdown con effetto sonoro Snippet Javascript 0
S countdown PHP 1
maxnegri Problema countdown Javascript 3
S Stampare un messaggio alla fine del countdown in Javascript Javascript 0
S Fare un Countdown con flash Flash 0
L Countdown con script Javascript 4
A Limite minimo con countdown textarea Javascript 0
maxnegri Stampare un messaggio alla fine di un countdown in javascript Javascript 0
M Countdown in asp Classic ASP 0
E Domanda countdown PHP PHP 3
T Countdown fra 2 date in ASP Classic ASP 12
M Differenza tra date e countdown PHP 5
J Top 10 Beautiful Christmas Countdown Timers Javascript 0
G Countdown per l'apertura di un sito Javascript 1
M Countdown script Javascript 1
M countdown Flash 0
M Countdown Server Side Classic ASP 0
C Conto alla rovescia - Countdown (al secondo) Javascript 1
G Countdown particolare Javascript 8
M Piccola intro con countdown!!! Presenta il tuo Sito 1
E requery e timer Database 1
otto9due Creare immagine dinamica timer (come esempio allegato) jQuery 4
A Timer countdownd di 1 ora Javascript 0
S Timer mit app inventor Sviluppo app per Android 1
Marco_88 Come fermare un timer (setTimeout) jQuery 6
Z timer al contrario Javascript 1
N Come inserire timer nei giochi del mio sito HTML e CSS 1

Discussioni simili