{html} <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script> <script src="http://keith-wood.name/js/jquery.countdown.js"></script> <style type="text/css">@import "http://keith-wood.name/css/jquery.countdown.css"; </style> <div id="defaultCountdown" style="width: 200px;"></div> <script> $(function () { var targetDate = new Date( 2012-1 + 1, 4 - 1, 21, 12-1, 0, 0); $('#defaultCountdown').countdown({until: targetDate, serverSync: serverTime, description:"Until touchdown", timezone: -6}); }); </script> <script> var liftoffTime = new Date(2012, 04, 25) jQuery(document).ready(function($) { $('#syncCountdown').countdown({since: new Date(2012, 12-1, 25)}); // $('#syncCountdown').countdown( {until: liftoffTime, serverSync: serverTime}); }); function serverTime() { var time = null; $.ajax({url: 'http://www.kiwispace.org.nz/mark/kiwimars/time.php', async: false, dataType: 'text', success: function(text) { time = new Date(text); }, error: function(http, message, exc) { time = new Date(); }}); return time; } </script> {html} |