js制作404错误页面5秒钟倒计时自动跳转

来源:互联网 发布:影楼网络客服好做吗 编辑:程序博客网 时间:2024/04/30 10:37
<!doctype html><html lang="zh-cn"><head><meta charset="utf-8"><title>404错误页面</title></head><body><div style="width:500px; height:350px; position:absolute; top:50%; left:50%; font-family:'Arial'; text-align:center; margin-left:-225px; margin-top:-175px;">    <h1 style="font-size:200px; line-height:0; color:#444;;">404</h1>    <p style="color:#ccc; font-size:18px;">Sorry,this page flew to the moon!</p>    <p><strong id="time" style="color:#D3070A;">5</strong>秒后自动跳转,如果不跳转,请点击下面的链接<a href="http://www.baidu.com/">返回首页</a></p></div>    <script type="text/javascript"> function delayURL(url) {var delay = document.getElementById("time").innerHTML;if(delay > 0) {delay--;document.getElementById("time").innerHTML = delay;} else {window.top.location.href = url;}setTimeout("delayURL('" + url + "')", 1000);}delayURL("http://www.baidu.com/");</script>     </body></html>

0 0
原创粉丝点击