如题
解决方案 »
- jquery easyui combotree 问题
- Scripting.FileSystemObject相对路径怎么写
- IE7下使用AlphaImageLoader可以上传预览图片,那读取文件size要怎么实现呢?
- javascript如何制作“删除”时有个提示
- ie9获得浏览器当前语言环境
- Ueditor编辑器问题, 急急急!!!可以加分
- 关于变量的问题~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 两个有关网页制作的问题,麻烦各位啦
- 小问题,请精通css的大虾回答
- javascript的for循环问题
- 不知道哪里出了问题,望指点啊~~~
- 关于做多个下拉菜单问题!!!!!!!!!!!!菜鸟求教!!!!
Date b= sdf.parse("1987-3-4");
Date a= new Date();
long time = (a.getTime()-b.getTime())/1000/60/60/24;
LeaveTime = AfterTime - new Date();
LeaveDays=Math.floor(LeaveTime/(1000*60*60*24));//天
LeaveHours=Math.floor(LeaveTime/(1000*60*60)%24);//时
LeaveMinutes=Math.floor(LeaveTime/(1000*60)%60);//分
LeaveSeconds=Math.floor(LeaveTime/1000%60);//秒
var q=1000-new Date().getMilliseconds();
if(q<10)
{
q="00"+q;
}
if(q>=10 && q<100)
{
q="0"+q;
}
document.getElementById("hxtime").innerHTML="距离下班还有<font color=red>"+LeaveHours+"</font>时<font color=red>"+LeaveMinutes+"</font>分<font color=red>"+LeaveSeconds+"</font>秒<font color=red>"+q+"</font>毫秒";
}
var AfterTime= new Date();
AfterTime.setHours(18,0,0,0);
setInterval(ShowTimes,100);
<span id="span_timer"></span><script type="text/javascript"> (function() {
var total = 3; // 倒计时
var span_timer = document.getElementById("span_timer");
span_timer.innerHTML = total;
var timer = setInterval(function() {
if (total <= 0) {
location.href = document.getElementById("a_url").href; // 跳转
clearInterval(timer);
timer = 0;
} else span_timer.innerHTML = --total;
}, 1000);
})();
</script>csdn的登陆倒计时js