倒计时时钟问题
我正在使用基思·伍德(Keith Wood)制作一个很酷的倒计时时钟,我注意到一些异常行为,并希望看看是否有人可以解决它。看着倒计时了一会,时钟似乎暂停了。它似乎跟踪了正确的时间,但正如您将看到的,它似乎在几秒钟后暂停了一秒多。
如果您观看大约 30 秒,您将看到它
http://dl .dropbox.com/u/2982102/temp/countdownclock_052411/index.html
对此的任何帮助都会非常
感谢
I am using Keith Wood for a cool countdown clock and am noticing some off behavior and was looking to see if anyone could nail it. The clock seems to pause after watching it count down for a while. It seems to track the right time but as you will see it just seems to pause a more than a second after several seconds.
If you watch it for about 30 seconds you will see it
http://dl.dropbox.com/u/2982102/temp/countdownclock_052411/index.html
Any help on this would be huge
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
问题可能在于该插件似乎以 980 毫秒的间隔进行更新,大概是希望确保它每秒执行一次。当然,随着时间的推移,这个间隔将远离秒之间的界限,并且最终可能会跳过偶尔的一秒。
显而易见的解决方案是减少间隔(也许略小于 500 毫秒,这应该安全地确保 99.9% 的时间至少每秒执行一次)。这应该是安全的,尽管可能值得查看性能以确保它不会太费力。
The issue is perhaps that the plugin appears to update using an interval of 980ms, presumably with the hope of ensuring it will execute each second. Of course, over time this interval will drift far from the boundary between seconds and could end up skipping the occasional second.
The obvious solution is to decrease the interval (perhaps slightly less than 500ms which should safely ensure it is executed at least once per second 99.9% of the time). This should be safe, although it might be worth looking at the performance to ensure it isn't too taxing.
我没看到你描述的内容。
然而,像这样的客户端代码,完全取决于用户的计算机配置和信息。因此,浏览器的性能可能会有很大差异。对于与此相关的任何问题,您无能为力。
某些数字图形似乎还没有完全加载,或者可能仍在“动态”加载。看看这个插件是否预加载图像可能是值得的。如果没有,您可能需要自己预加载它们。
I'm not seeing what you describe.
However, something like this, client-side code, depends totally on the user's computer configuration & browser, therefore, performance might vary greatly. For any issues related to this, there's not much you can do.
It also appears as if some of the graphics for the numbers are not fully loaded, or perhaps they are still loading "on the fly". It might be worthwhile to see if this plugin is pre-loading the images. If not, you may want to pre-load them yourself.
它有时似乎运行得有点太快并开始超过正确的值。
暂停是指连续两次显示相同的值,第一个是超前的(即错误的),第二个是正确的。
It seems to sometimes run a little too fast and start to get ahead of the correct value.
The pause is when it's showing the same value for 2 consecutive ticks, the first being ahead (ie, wrong) and the second being correct.