php显示倒数,js来控制
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/...
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>酱油广告</title>
</head>
<body onload="window.setTimeout('window.close()',5000)">
我只是一个打酱油的广告,<span id="runtime"></span>秒后自动消失。。。
</body>
</html>
<Script Language ="JavaScript">
</Script>
如上代码。我想要再id=runtime那里显示5秒的动态倒数,js怎么写? 展开
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>酱油广告</title>
</head>
<body onload="window.setTimeout('window.close()',5000)">
我只是一个打酱油的广告,<span id="runtime"></span>秒后自动消失。。。
</body>
</html>
<Script Language ="JavaScript">
</Script>
如上代码。我想要再id=runtime那里显示5秒的动态倒数,js怎么写? 展开
2个回答
展开全部
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<title>酱油广告</title>
</head>
<body onload="close_page();">
我只是一个打酱油的广告,<span id="runtime"></span>秒后自动消失。。。
<Script type ="text/javascript">
var runtime = document.getElementById("runtime");
var seconds = 5;
function close_page(){
runtime.innerHTML = seconds;
if(seconds == 0)
window.close();
else
window.setTimeout('close_page()',1000);
seconds--;
}
</Script>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<title>酱油广告</title>
</head>
<body onload="close_page();">
我只是一个打酱油的广告,<span id="runtime"></span>秒后自动消失。。。
<Script type ="text/javascript">
var runtime = document.getElementById("runtime");
var seconds = 5;
function close_page(){
runtime.innerHTML = seconds;
if(seconds == 0)
window.close();
else
window.setTimeout('close_page()',1000);
seconds--;
}
</Script>
</body>
</html>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询