首页 >

JS 实现倒计时数字时钟效果【附实例代码】【javascript】

web前端|js教程JS 实现倒计时数字时钟效果【附实例代码】【javascript】
JS,倒计时,数字,时钟
web前端-js教程本文实例讲述了JS实现的网页倒计时数字时钟效果。分享给大家供大家参考。具体实现方法如下:
微擎源码存放,鼠标变为加号在vscode,ubuntu耗电严重,页面实现重启tomcat,金融爬虫招聘,php 奇偶数,武夷山公司seo报价,企业商城网站html源码,苹果cms后台模板文件lzw
javascript实现的倒计时时钟body,div{margin:0;padding:0;}body{color:#fff;font:16px/1.5 \5fae\8f6f\96c5\9ed1;}#countdown{width:300px;text-align:center;background:#1a1a1a;margin:10px auto;padding:20px 0;}input{border:0;width:283px;height:50px;cursor:pointer;margin-top:20px;background:url(http://www.liuzhongwei.com/jscss/demoimg/201210/btn-1.jpg) no-repeat;}input.cancel{background-position:0 -50px;}span{color:#000;width:80px;line-height:2;background:#fbfbfb;border:2px solid #b4b4b4;margin:0 10px;padding:0 10px;}window.onload = function (){var oCountDown = document.getElementById("countdown");var aInput = oCountDown.getElementsByTagName("input")[0];var timer = null;aInput.onclick = function (){this.className == "" ? (timer = setInterval(updateTime, 1000), updateTime()) : (clearInterval(timer));this.className = this.className == '' ? "cancel" : '';};function format(a){return a.toString().replace(/^(\d)$/,'0$1')}function updateTime (){var aSpan = oCountDown.getElementsByTagName("span");var oRemain = aSpan[0].innerHTML.replace(/^0/,'') * 60 + parseInt(aSpan[1].innerHTML.replace(/^0/,''));if(oRemain <= 0){clearInterval(timer);return}oRemain--;aSpan[0].innerHTML = format(parseInt(oRemain / 60));oRemain %= 60;aSpan[1].innerHTML = format(parseInt(oRemain));}}
01分钟40秒
码农教学 www.manongjc.com 代码特效
h5下载网站源码下载,ubuntu登录密码忘,爬虫软件黄图,php不使用第三个变量实现交换,seo平台素材lzw

  • 暂无相关文章
  • Posted in 未分类