Stampare un messaggio alla fine di un countdown in javascript

maxnegri

Utente Attivo
12 Ott 2004
87
0
6
Salve ho trovato questo script in rete, l'ho installato e funziona ma quando termina il contdown vorrei stampare un messaggio del tipo "annuncio terminato".
Avete qualche idea?
Lo script è il seguente:

Codice:
<!--Countdown Timer starts here-->
<script type="text/javascript">
// Description: displays the amount of time until the "dateFuture" entered below.
// NOTE: the month entered must be one less than current month. ie; 0=January, 11=December
// NOTE: the hour is in 24 hour format. 0=12am, 15=3pm etc
// format: dateFuture = new Date(year,month-1,day,hour,min,sec)
// example: dateFuture = new Date(2003,03,26,14,15,00) = April 26, 2003 - 2:15:00 pm
 
dateFuture = new Date('<?php echo $coopen_timer[0]; ?>','<?php echo ($coopen_timer[1] - 1) ; ?>','<?php echo $coopen_timer1[0]; ?>','<?php echo $coopen_timer3[0]; ?>','<?php echo $coopen_timer3[1]; ?>','<?php echo $coopen_timer3[2]; ?>'); 

//alert(dateFuture);

function GetCount(){

	dateNow = new Date();									//grab current date
	amount = dateFuture.getTime() - dateNow.getTime();		//calc milliseconds between dates
	delete dateNow;

		days=0;hours=0;mins=0;secs=0;nodays="";nohrs="";nomins="";

		amount = Math.floor(amount/1000);//kill the "milliseconds" so just secs

		days=Math.floor(amount/86400);//days
		amount=amount%86400;

		hours=Math.floor(amount/3600);//hours
		amount=amount%3600;

		mins=Math.floor(amount/60);//minutes
		amount=amount%60;

		secs=Math.floor(amount);//seconds

		if(days != 0)
		{
		nodays = days +((days!=1)?"":"");
		//alert(nodays);
		document.getElementById('tot_days').innerHTML=nodays;
		}
		else
		{
		document.getElementById('tot_days').innerHTML='';		
		document.getElementById('days').innerHTML='';		
		}
		
		if(days != 0 || hours != 0)
		{
		nohrs = hours +((hours!=1)?"":"");
		//alert(nohrs);
		document.getElementById('tot_hrs').innerHTML=nohrs;		
		}
		else
		{
		document.getElementById('tot_hrs').innerHTML='';		
		document.getElementById('hrs').innerHTML='';		
		}
				
		if(days != 0 || hours != 0 || mins != 0)
		{
		nomins = mins +((mins!=1)?"":"");
		//alert(nomins);
		document.getElementById('tot_mins').innerHTML=nomins;				
		}
		else
		{
		document.getElementById('tot_mins').innerHTML='';		
		document.getElementById('mins').innerHTML='';		
		}		
		
		document.getElementById('tot_secs').innerHTML = secs;
		setTimeout("GetCount()", 1000);
		
}

window.onload=GetCount;//call when everything has loaded

</script>
<!--Countdown Timer ends here-->

Grazie per l'attenzione
 

Discussioni simili