首页 > 编程语言 > 详细

【JavaScript&jQuery】5秒跳转

时间:2017-02-09 15:53:24      阅读:115      评论:0      收藏:0      [点我收藏+]
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<!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" dir="ltr" lang="en-US" xml:lang="en">
    <head>  
        <title>404错误页面</title>  
        <meta charset="utf-8">  
        <meta http-equiv="pragma" content="no-cache">  
        <meta http-equiv="cache-control" content="no-cache">  
        <meta http-equiv="expires" content="0">  
        <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">  
        <meta http-equiv="description" content="This is my page">  
        <link rel="stylesheet" href="css/bootstrap.min.css" />  
        <style>  
            body{background: url(images/404.jpg);background-size: cover;}  
            .error{width: 100px;margin: 0 auto;}  
            #count b{font-size: 65px;color:#BF3333;}  
        </style>  
    </head>  
  
    <body>  
        <div class="error">  
            <span id = "count"><b> 5 </b></span>  
            <a class="btn btn-warning" href="index.html">点击返回</a>  
        </div>  
        <script type="text/javascript" src="js/jquery-1.6.4.js" ></script>  
        <script type="text/javascript">  
            $(function() {  
                var count = 5;  
                setInterval(function() {  
                    count--;  
                    if (count <= 0) window.location.href = "index.html";  
                    $("#count").html("<b>" + count + "</b>");  
                }, 1000);   
            });  
        </script>  
    </body>  
  
</html>  

 

【JavaScript&jQuery】5秒跳转

原文:http://www.cnblogs.com/dflmg/p/6382308.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!