本文实例为大家分享了JS实现网页时钟特效的具体代码,供大家参考,具体内容如下
主要逻辑 根据JS 的Date属性 求得当前的 时 分 秒 之后,按照 360/(时|分|秒) 来对三个指针元素进行旋转
Title #box { width: 600px; height: 600px; background: url("img/bg.png") no-repeat; background-size: cover; margin: 30px auto; position: relative; overflow: hidden; } #h{ width:100%; height:100%; background: url("img/h.png") no-repeat; background-size: cover; position: absolute; } #m{ width:100%; height:100%; background: url("img/m.png") no-repeat; background-size: cover; position: absolute; } #s{ width:100%; height:100%; background: url("img/s.png") no-repeat; background-size: cover; position: absolute; }
更多Javascript时钟特效点击查看:Javascript时钟特效专题
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持考高分网。



