jQuery Countdown

jQuery Countdown Drupal Module

Provides the jQuery Countdown plugin by Keith Wood, along with a simple API function (jquery_countdown_add) to easily add countdown/countup timer elements to the page.

Example

We can use jQuery Countdown in two different ways, one is using theme('jquery_countdown'), the other is using jquery_countdown_add(). The following would display the amount of time since the New Year...

<?php
 
echo theme('jquery_countdown', array(
   
'since' => date("F d, Y g:i a", mktime(0,0,0,0,0,2009)),
   
'format' => 'YOWDHMS',
   
'description' => t('Since New Year'),
  ));
?>

In this example, we display an alert box saying "You are done!" after counting down from 10...

<?php
 
echo '<div class="countdown">10 seconds!</div>';
 
jquery_countdown_add(".countdown", array("until" => 10, "onExpiry" => "finished"));
 
drupal_add_js("function finished() { alert('You are done!'); }", 'inline');
?>

Releases

Official releasesDateSizeLinksStatus
6.x-1.52009-Nov-2827.05 KBRecommended for 6.xThis is currently the recommended release for 6.x.
Development snapshotsDateSizeLinksStatus
6.x-1.x-dev2009-Nov-2927.06 KBDevelopment snapshotDevelopment snapshots are automatically regenerated and their contents can frequently change, so they are not recommended for production use.


 
 

Drupal is a registered trademark of Dries Buytaert.