这个js倒计时计算到天、小时、分钟、秒钟,很详细的倒计时,实用倒计时网页特效,结合自己的 需求来修改即可。
<SCRIPT LANGUAGE="JavaScript"> <!-- Begin function getTime() { now = new Date(); y2k = new Date("Jan 1 2060 14:00:00"); days = (y2k - now) / 1000 / 60 / 60 / 24; daysRound = Math.floor(days); hours = (y2k - now) / 1000 / 60 / 60 - (24 * daysRound); hoursRound = Math.floor(hours); minutes = (y2k - now) / 1000 /60 - (24 * 60 * daysRound) - (60 * hoursRound); minutesRound = Math.floor(minutes); seconds = (y2k - now) / 1000 - (24 * 60 * 60 * daysRound) - (60 * 60 * hoursRound) - (60 * minutesRound); secondsRound = Math.round(seconds); sec = (secondsRound == 1) ? " second." : " seconds."; min = (minutesRound == 1) ? " minute" : " minutes, "; hr = (hoursRound == 1) ? " hour" : " hours, "; dy = (daysRound == 1) ? " day" : " days, " document.timeForm.input1.value = "剩余时间: " + daysRound + dy + hoursRound + hr + minutesRound + min + secondsRound + sec; newtime = window.setTimeout("getTime();", 1000); }//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) // End --> </script> <body bgcolor="#fef4d9" onLoad="getTime()"> <a href="https://www.wuming.ren">武鸣人</a>,各种信息资源免费发布,分享励志语录经典短句,减肥健身常识,各种js特效代码。网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)<hr> <!--欢迎来到武鸣人信息资源平台,各种信息免费发布,资源共享合作共赢,分享互联网流行的励志语录经典短句,减肥健身健康小常识及打卡记录,收集各种js特效代码。--> <script type="text/javascript" src="https://www.wuming.ren/ad/tc.js"></script> <script type="text/javascript" src="https://www.wuming.ren/ad/a.js"></script> 距离: Jan 1, 2060 2:00:00 p.m. <form name=timeForm> <input type=text name=input1 size=70 border-style="none" style="border-bottom: 0px solid; border-left: 0px solid;border-right: 0px solid;border-top: 0px solid;font:12px arial, helvetica,sans-serif"> </form> </body>
本文来自武鸣人网站,转载请注明出处