在html页面加一个倒计时90分钟代码怎么写
5个回答
展开全部
<html>
<head>
</head>
<body>
<div id="timeshow">
</div>
<script type="text/javascript">
var time=new Date();
time.setHours(1);
time.setMinutes(30);
time.setSeconds(0);
var timeout;
var timeshow=document.getElementById("timeshow");
function countdown(){
var hour=time.getHours();
var min=time.getMinutes();
var second=time.getSeconds();
if(hour=="0"&&min=="0"&&second=="0"){alert("Time Out!");clearInterval(timeout);}
time.setSeconds(second-1);
hour<10?hour="0"+hour:hour;
min<10?min="0"+min:min;
second<10?second="0"+second:second;
timeshow.innerHTML=hour+":"+min+":"+second;
}
timeout= setInterval(countdown,1000);
</script>
</body>
</html>
初学菜鸟 编的不好请指教
<head>
</head>
<body>
<div id="timeshow">
</div>
<script type="text/javascript">
var time=new Date();
time.setHours(1);
time.setMinutes(30);
time.setSeconds(0);
var timeout;
var timeshow=document.getElementById("timeshow");
function countdown(){
var hour=time.getHours();
var min=time.getMinutes();
var second=time.getSeconds();
if(hour=="0"&&min=="0"&&second=="0"){alert("Time Out!");clearInterval(timeout);}
time.setSeconds(second-1);
hour<10?hour="0"+hour:hour;
min<10?min="0"+min:min;
second<10?second="0"+second:second;
timeshow.innerHTML=hour+":"+min+":"+second;
}
timeout= setInterval(countdown,1000);
</script>
</body>
</html>
初学菜鸟 编的不好请指教
展开全部
倒计时: <span id="time-left"></span>
<script language="javascript">
var g_iTimeLeft = 90*60;
setInterval(function(){
g_iTimeLeft--;
document.getElementById("time-left").innerHTML = g_iTimeLeft;
},1000);
</script>
<script language="javascript">
var g_iTimeLeft = 90*60;
setInterval(function(){
g_iTimeLeft--;
document.getElementById("time-left").innerHTML = g_iTimeLeft;
},1000);
</script>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
<html>
<head>
</head>
<body>
<div
id="timeshow">
</div>
<script
type="text/javascript">
var
time=new
Date();
time.setHours(1);
time.setMinutes(30);
time.setSeconds(0);
var
timeout;
var
timeshow=document.getElementById("timeshow");
function
countdown(){
var
hour=time.getHours();
var
min=time.getMinutes();
var
second=time.getSeconds();
if(hour=="0"&&min=="0"&&second=="0"){alert("Time
Out!");clearInterval(timeout);}
time.setSeconds(second-1);
hour<10?hour="0"+hour:hour;
min<10?min="0"+min:min;
second<10?second="0"+second:second;
timeshow.innerHTML=hour+":"+min+":"+second;
}
timeout=
setInterval(countdown,1000);
</script>
</body>
</html>
初学菜鸟
编的不好请指教
<head>
</head>
<body>
<div
id="timeshow">
</div>
<script
type="text/javascript">
var
time=new
Date();
time.setHours(1);
time.setMinutes(30);
time.setSeconds(0);
var
timeout;
var
timeshow=document.getElementById("timeshow");
function
countdown(){
var
hour=time.getHours();
var
min=time.getMinutes();
var
second=time.getSeconds();
if(hour=="0"&&min=="0"&&second=="0"){alert("Time
Out!");clearInterval(timeout);}
time.setSeconds(second-1);
hour<10?hour="0"+hour:hour;
min<10?min="0"+min:min;
second<10?second="0"+second:second;
timeshow.innerHTML=hour+":"+min+":"+second;
}
timeout=
setInterval(countdown,1000);
</script>
</body>
</html>
初学菜鸟
编的不好请指教
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
需要脚本语言 比如 aps php 等等 或者直接调用FAlSH
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
<script type="text/javascript">
setInterval(function() {
var date = new Date();
var EndDate = (new Date('2022-2-4 08:00:00')).getTime();
var ms = EndDate - date;
var seconds = ms / 1000;
var points = seconds / 60;
var hours = points / 60;
var day = hours / 24;
var time = document.getElementById("time");
time.innerHTML = Math.floor(day) + "天" ;
var time1 = document.getElementById("time1");
time1.innerHTML = Math.floor(hours % 24) + "时" ;
var time2 = document.getElementById("time2");
time2.innerHTML = Math.floor(points % 60) + "分";
var time3 = document.getElementById("time3");
time3.innerHTML = Math.floor(seconds % 60) + "秒";
}, 1000)
</script>
setInterval(function() {
var date = new Date();
var EndDate = (new Date('2022-2-4 08:00:00')).getTime();
var ms = EndDate - date;
var seconds = ms / 1000;
var points = seconds / 60;
var hours = points / 60;
var day = hours / 24;
var time = document.getElementById("time");
time.innerHTML = Math.floor(day) + "天" ;
var time1 = document.getElementById("time1");
time1.innerHTML = Math.floor(hours % 24) + "时" ;
var time2 = document.getElementById("time2");
time2.innerHTML = Math.floor(points % 60) + "分";
var time3 = document.getElementById("time3");
time3.innerHTML = Math.floor(seconds % 60) + "秒";
}, 1000)
</script>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |