用JS写了一个30分钟倒计时器的实现示例

用JS写了一个30分钟倒计时器的实现示例


2023年12月27日发(作者:)

refreshTable:function(){ //进度条 var table = mentById("table1") var span = mentById('numbers')

//刷新进度条 // =

= Width + "px" var progress = 1

if(conds > 0) progress = conds / (nutes * 60)

elector('#table1 td:nth-of-type(1)'). = progress * 100 + "%"

var td2 = elector('#table1 td:nth-of-type(2)')

if (progress < 1){ = (1 - progress) * 100 + "%" }else{ y = "none" }

var canvas = mentById('myCanvas') = Width

var ctx = text("2d") var rectWeight = progress * Width

ect(0, 0, Width, 20) yle = "#FF0000" //("rectWeight: " + rectWeight) //(progress * Width) ct(0, 0, rectWeight, 20) }, init:function(){ ime = () var span = mentById('numbers') tSize()

conds = nutes * 60

= nutes

var obj = this

= setInterval(function(){

if(ag) return

if(conds > 0){ TML = "" + ( < 10 ? "0" + : ) + ":" +

(!lag ? ( < 10 ? "0" + : ) : " ".repeat(4))

if(conds > 0){ conds -= 1 }

= (conds / 60) = conds - * 60

//刷新进度条 hTable()

}else{ TML = "Time " nterval() mentById("music2").play()

//跑完后记录 var content = mentById("content").value wnRecord(content)

//不停地闪烁 erval(function(){


发布者:admin,转转请注明出处:http://www.yc00.com/web/1703673168a1310685.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信