| Issue 13: | EC_STOPWATCH not tearing | |
| 1 person starred this issue and may be notified of changes. | Back to list |
There seems to be a problem with mode: EC_STOPWATCH. According to your documentation the timer should "tear" away when paused, and continue counting when resumed. I'm experiencing the opposite, that the clock continues to count in the background while the digits are frozen. The clock also seems to start counting once I instantiate it, instead of when I call .clocks() for the first time. Please see the code example below, or the attached .rar'ed file that also contains the .js files I'm using. I've tried both jQuery 1.3 and 1.4, in addition to various versions of epiClock from 2.1.2 and up. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Countdown</title> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.epiclock.js"></script> <script type="text/javascript"> var running = false; $(function() { $("#clock").epiclock({mode: EC_STOPWATCH}); $("#button").click(function(){ if (running) { $("#clock").clocks(EC_HALT); } else { $("#clock").clocks(); } running = !running; }); }); </script> </head> <body> <span id="clock"></span> <span id="button">START/STOP</span> </body> </html>
Jan 19, 2010
(No comment was entered for this change.)
Status:
Fixed
Owner: garside |
Thanks for the perfect bug report. :) I managed to find the problem. For whatever reason when I rewrote the script for jQuery, I believe the stopwatch never worked, as the jQuery.epiclock(EC_*) calls were not being provided to the elements through their jQuery('#element').epiclock() calls. I updated the source a bit and released 2.2.2 which should now properly tear stopwatches on pause, and properly start the stopwatch from the first EC_RUN/resume call made to the clock.