I recently came across the need to have a countdown displayed in one of our applications. I was going to be releasing a new version of our app and wanted the users to have an idea of how long it was going to take until the application was up and running. After a few searches I found a plugin that does just what I needed, it is a jquery plugin, very simple to use and to add to any php application in just a matter of minutes.
The plugin is called jQuery Countdown, and it can be found here. This is a simple plugin and as their site states, it sets a div or span to show a countdown to/from a given time.
Enough said, this is how you do it:
1. Download jquery and load it to your app server, all you need is the bare minimum, so just get jquery.min.js. Assuming your application is located in /var/www/, create a folder for jquery and place the file there:
cd /var/www/ mkdir jquery cd jquery wget http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js
2. Download the jQuery Countdown package to your computer. The package is a zip file, all you need are 2 files from it.
Open it and extract only the 2 files called jquery.countdown.css and jquery.countdown.js to the jquery folder you created on your server (same place where you placed jquery.min.js in the step above).
3. Now create the php page that will display the countdown. jquery.countdown has many different options you can use, these are just a few I have used to create my countdown, please visit their site to see the entire list of options and all different settings you can use: