Categories:

Home / Free JavaScripts / Clocks, Calenders, And Timers / Here

Cut & Paste Count down until any date II

Credit: JavaScript Kit

Description: A versatile and practical script that can be used to count down until any given date. This version of the script uses images. For a text version, click here.

Example:

Directions

Step 1: Copy the below images into your web page directory. Be sure to preserve the images' file names.

       

Step 2: Copy the below code into the <body> section of your page:

There are two areas of the script you'll need to configure. The first is obviously the date you wish the script to count down to. Simply pass in a date, in the form of year, month, and day, into function countdown(), located at the last line of the script:

countdown(2003,12,25)

The second concerns the text to be displayed during the duration of the countdown. This is affected by the lines:

var before="Christmas!"
var current="Today is Christmas. Merry Christmas!"

The first variable (var before) specifies the key word that will be used to display the sentence ""Only so and so days until ____." The second variable specifies the text to be displayed when the counter has expired (the specified countdown-to date).


JavaScript Tools:
Site Info


CopyRight (c) 2018 JavaScript Kit. NO PART may be reproduced without author's permission. Contact Info