2012世界末日倒计时代码 原来没事虚惊一场
2012-12-15 00:00
281 查看
这款时世界末日倒计时源代码,程序上有JS控制器,是用于网页中显示的倒计时器,自己可以设定世界末日的开始时间,网页倒计时世界末日源代码直接复制就可以用,无需下载,直接便可使用
网页倒计时世界末日源代码_js倒数世界之末日_脚本之家
function fu_count2012() {
var days = document.getElementById("countDays");
var hours = document.getElementById("countHours");
var minutes = document.getElementById("countMinutes");
var seconds = document.getElementById("countSeconds");
var timeTotal = new Date();
var mSecondTotal = timeTotal.getTime();
var timeTotal2012 = new Date(2012,11,21,0,0,0);
var mSecondTotal2012 = timeTotal2012.getTime();
var mtimes = mSecondTotal2012 - mSecondTotal;
var getDays = Math.floor(mtimes / 1000 / 60 / 60 / 24);
var getHours = Math.floor(mtimes / 1000 / 60 / 60 % 24);
var getMinutes = Math.floor(mtimes / 1000 / 60 % 60);
var getSeconds = Math.floor(mtimes / 1000 % 60);
getHours = (getHours < 10) ? "0"+getHours : getHours;
getMinutes = (getMinutes < 10) ? "0"+getMinutes : getMinutes;
getSeconds = (getSeconds < 10) ? "0"+getSeconds : getSeconds;
days.innerHTML = getDays;
hours.innerHTML = getHours;
minutes.innerHTML = getMinutes;
seconds.innerHTML = getSeconds;
setTimeout("fu_count2012()", 1000);
}
window.onload = fu_count2012;
body {
background: #000000;
color: #ffffff;
text-align: center;
}
距离2012年12月31日还有
天小时分钟秒
[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]
网页倒计时世界末日源代码_js倒数世界之末日_脚本之家
function fu_count2012() {
var days = document.getElementById("countDays");
var hours = document.getElementById("countHours");
var minutes = document.getElementById("countMinutes");
var seconds = document.getElementById("countSeconds");
var timeTotal = new Date();
var mSecondTotal = timeTotal.getTime();
var timeTotal2012 = new Date(2012,11,21,0,0,0);
var mSecondTotal2012 = timeTotal2012.getTime();
var mtimes = mSecondTotal2012 - mSecondTotal;
var getDays = Math.floor(mtimes / 1000 / 60 / 60 / 24);
var getHours = Math.floor(mtimes / 1000 / 60 / 60 % 24);
var getMinutes = Math.floor(mtimes / 1000 / 60 % 60);
var getSeconds = Math.floor(mtimes / 1000 % 60);
getHours = (getHours < 10) ? "0"+getHours : getHours;
getMinutes = (getMinutes < 10) ? "0"+getMinutes : getMinutes;
getSeconds = (getSeconds < 10) ? "0"+getSeconds : getSeconds;
days.innerHTML = getDays;
hours.innerHTML = getHours;
minutes.innerHTML = getMinutes;
seconds.innerHTML = getSeconds;
setTimeout("fu_count2012()", 1000);
}
window.onload = fu_count2012;
body {
background: #000000;
color: #ffffff;
text-align: center;
}
距离2012年12月31日还有
天小时分钟秒
[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]
<div id="container">离"世界末日"还有 <span id="downtime" style="color:red"></span></div> <script> function downTime(){ var timeout = window.setTimeout(downTime, 100); var endTime=new Date("12-21-2012 0:0:0");//改成你的计时日期 var today=new Date(); var timeold=(endTime.getTime()-today.getTime()); if(timeold <= 100){ window.clearTimeout(timeout); document.getElementByIdx_x("container").innerHTML = "原来没事啊,虚惊一场!"; return; } var sectimeold=timeold/1000; var secondsold=Math.floor(sectimeold); var msPerDay=24*60*60*1000; var e_daysold=timeold/msPerDay; var daysold=Math.floor(e_daysold); var e_hrsold=(e_daysold-daysold)*24; var hrsold=Math.floor(e_hrsold); var e_minsold=(e_hrsold-hrsold)*60; var minsold=Math.floor((e_hrsold-hrsold)*60); var e_seconds=(e_minsold-minsold)*60; var seconds=Math.floor((e_minsold-minsold)*60); var decimals = Math.floor((e_seconds-seconds)*10); document.getElementByIdx_x("downtime").innerHTML=daysold+"天"+hrsold+"小时"+minsold+"分"+seconds+"."+decimals+"秒" ; } downTime(); </script>
相关文章推荐
- 2012世界末日倒计时代码 原来没事虚惊一场
- 原来是虚惊一场...
- 【黑屏解决】抓狂过后:一阵青烟冒出,原来只是虚惊一场!
- 绩点计算机原来的代码
- 北京奥运会倒计时代码
- 北京奥运会倒计时代码
- javascript倒计时功能实现代码
- iOS中一句代码解决倒计时问题
- iOS中实现简单易懂秒杀倒计时/倒计时代码
- js实现倒计时60秒的简单代码
- Js倒计时代码,当鼠标离开页面与回到页面会自动停止与开始
- 对原来的模块修改后,最好在解释器里把修改好的代码重新写再粘贴到py文件里,否则F5运行py模块时,总是出错误,如缩进不对 如for语句没写冒号 就导致cmd sdist和install 出错
- android 代码片段,实现60秒倒计时
- 好好写代码吧,没事别瞎B去创业!
- JQuery实现倒计时按钮的实现代码
- 状态很差时,就不要再继续做了。因为是徒劳,再就是过段时间或第二天再看,会豁然开朗,原来存在的疑难问题都迎刃而解。平时没事的时候要不断地给自己充电,让自己了解多方面知识。
- javascript倒计时效果代码,可以方便参数调用
- 虚惊一场呀!狂汗
- 虚惊一场
- JavaScript实现以天为单位的倒计时代码