jQuery 1分钟倒计时,包含毫秒和回调 [英] jQuery 1 minute countdown with milliseconds and callback

查看:171
本文介绍了jQuery 1分钟倒计时,包含毫秒和回调的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试找出一种显示简单倒数的方法,该倒数显示为1:00:00,其中1 =分钟,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.

我在互连网上发现了许多jQuery倒计时,但是其中没有一个能够本地显示毫秒,而且我真的不想挖掘成千上万行代码来尝试找到一种破解方法它自己放在里面.

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?

我也希望能够在倒计时(0:00:00)的末尾添加一个回调,以便在结束时可以运行另一个函数.

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.

推荐答案

这听起来有些袖手旁观,但是如果您制作了一个小型动画GIF,该GIF每秒运行十个两位数的随机集,则每秒十次,您的用户永远不会知道它们之间的区别,并且您不必担心要通过尝试在网页中计算毫秒数来应对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.

这篇关于jQuery 1分钟倒计时,包含毫秒和回调的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆