jQuery 1 分钟倒计时,带毫秒和回调
我试图找到一种方法来显示一个简单的倒计时,显示 1:00:00,其中 1 = 分钟,00 = 秒,00 = 毫秒。
我在互联网上发现了大量的 jQuery 倒计时,但没有一个包含本地显示毫秒的能力,而且我真的不想挖掘数千行代码来尝试找到一种方法来破解它我。
这是很容易就能搞定的事情吗?
我还希望能够在倒计时结束时 (0:00:00) 添加回调,以便在倒计时结束时我可以运行另一个函数。
I'm trying to figure out a way to display a simple countdown that displays 1:00:00 whereby 1 = minutes, 00 = seconds, and 00 = milliseconds.
I've found loads of jQuery countdowns on the interwebs, but none of the contain the ability to display milliseconds natively, and I really don't want to dig through thousands of lines of code to try and find a way to hack it in there myself.
Is this something that would be pretty easy to whip up?
I'm also hoping to have the ability to add a callback to the end of the countdown (0:00:00) so that when it finishes, I can run another function.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这听起来有点即兴,但如果您制作一个小型动画 GIF,每秒运行 10 组随机的两位数十次,您的用户将永远不会知道其中的差异,而且您也不必担心通过尝试在网页中倒计时毫秒,您将如何处理 CPU 负载。
This is going to sound a bit off the cuff, but if you make a small animated GIF that runs through ten random sets of two digits ten times a second, your users will never know the difference, and you won't have to worry about what you're going to do to your CPU load by trying to count down milliseconds in a web page.
大家好,我已经为自己开发了一个代码,使用以下代码计数器 20 秒
Hi guys I have developed a code for my self use the following code counter for 20 seconds