【HTML网页代码修改】求修改这个正计时代码—使其能够在网页上显示时...
发布网友
发布时间:2022-04-26 16:57
我来回答
共1个回答
热心网友
时间:2022-04-21 03:54
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cn" lang="cn">
<head>
<title></title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<style type="text/css">
#thenceThen{font-size:2em;}
</style>
<script type="text/javascript" language="javascript">
function thenceThen(timespan){
var date1=new Date(timespan);
var totalSecs=(new Date()-date1)/1000;
var days=Math.floor(totalSecs/3600/24);
var hours=Math.floor((totalSecs-days*24*3600)/3600);
var mins=Math.floor((totalSecs-days*24*3600-hours*3600)/60);
var secs=Math.floor((totalSecs-days*24*3600-hours*3600-mins*60));
document.getElementById("thenceThen").innerText="距今:"+days+"天"+hours+"小时"+mins+"分钟"+secs+"秒";
}
var clock;
window.onload=function(){
clock=self.setInterval("thenceThen('2005/01/01')", 500);
}
</script>
</head>
<body>
<div id="thenceThen"></div>
</body>
</html></font>
<a href="https://js.alixixi.com/">欢迎访问阿里西西网页特效代码站,js.alixixi.com</a>