jQuery Countdown
Rob Loach - December 1, 2008 - 22:38
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 releases | Date | Size | Links | Status | |
|---|---|---|---|---|---|
| 6.x-1.5 | 2009-Nov-28 | 27.05 KB | Download · Release notes | Recommended for 6.x | |
| Development snapshots | Date | Size | Links | Status | |
|---|---|---|---|---|---|
| 6.x-1.x-dev | 2009-Nov-29 | 27.06 KB | Download · Release notes | Development snapshot | |
