<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>index</title>
<style>
*{
font-family: 微软雅黑;
}
.clock{
width:100%;
height:50px;
background: #000;
color:#fff;
font-weight: bold;
border-radius:50px;
text-align:center;
line-height:50px;
}
</style>
</head>
<body>
<div class="clock">
<span>提交成功,<span id='sid'>3</span>秒后页面即将跳转到百度!</span>
</div>
</body>
<script>
sidobj=document.getElementById('sid');
s=3;
sobj=setInterval(function(){
sidobj.innerHTML=--s;
if(s==0){
location='http://www.baidu.com';
}
},1000);
</script>
</html>
这里给的例子是跳转到百度页面,需要修改的话直接该网址就好、
上面例子显示倒数3秒时间,下面的例子用JS的超时器实现,不显示时间倒数,但仍然能实现跳转
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>index</title>
<style>
*{
font-family: 微软雅黑;
}
.clock{
width:100%;
height:50px;
background: #000;
color:#fff;
font-weight: bold;
border-radius:50px;
text-align:center;
line-height:50px;
}
</style>
</head>
<body>
<div class="clock">
<span>提交成功,<span id='sid'>3</span>秒后页面即将跳转到百度!</span>
</div>
</body>
<script>
sidobj=document.getElementById('sid');
s=3;
sobj=setTimeout(function(){
location='http://www.baidu.com';
},3000);
</script>
</html>