|
You can use this for any countdown to a specified date.
- Create a Text Box on your page where you want the countdown to appear.
- Right-click on that Text box and select “Object HTML”
- In the “Before Tag” field, enter this code:
|
<SCRIPT LANGUAGE="JavaScript"> <!--
// Copyright (c) 2000 internet.com Corp. // http://www.webreference.com/js/ // License is granted if and only if this entire // copyright notice is included. By Tomer Shiran.
var now = new Date(); var then = new Date("January 1, 2002"); var left = then.getTime() - now.getTime(); var days = Math.floor(left / (1000 * 60 * 60 * 24)); // var hours = Math.floor(left / (1000 * 60 * 60));// var minutes = Math.floor(left / (1000 * 60));// var seconds = Math.floor(left / 1000); if (days > 1) document.write("Only " + days + " days left 'till the year 2002!") else if (days == 1) document.write("Only one day left 'till the year 2002!") else if (days == 0) document.write("Less than a day left 'till the year 2002!") else // days < 0 document.write("The year 2002 is history!");
// --> </SCRIPT> <!--
|
|
- Click on the “After Tag” tab, and enter this code:
- Click on “Ok”
|