Blogger Information
Blog 20
fans 0
comment 0
visits 25103
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
js生成倒计时跳转页面
左手Leon的博客
Original
904 people have browsed it

实例

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>倒计时跳转</title>
	<style type="text/css">
		p{width:300px;height: 50px;margin: 100px auto;}
		span{display: inline-block;height:50px;width: 50px;line-height: 50px;font-size: 30px;color:#f00;text-align: center}
	</style>
</head>
<body>
	
	<p>
		还剩<span>5</span>跳转至<a href="http://www.baidu.com">百度</a>
	</p>
	<div style="width:100px; height:100px" ></div>
	<script type="text/javascript">
			var i=4;
			var Espan=document.getElementsByTagName('span')[0];
			function fn(){
				
				
				if(i>0){
					Espan.innerHTML=i;
					i--;
				}else{
					window.location.href = 'http://www.baidu.com';
				}
			}
			setInterval('fn()',1000)
		
	</script>
</body>
</html>

运行实例 »

点击 "运行实例" 按钮查看在线实例


Correction status:Uncorrected

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!