zoukankan      html  css  js  c++  java
  • [转]Jquery实现页面定时跳转

     

      1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
      2. <html xmlns="http://www.w3.org/1999/xhtml">  
      3. <html>    
      4.   <head>    
      5.   <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />  
      6.     <title>跳转页面</title>     
      7.     <mce:script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" mce_src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></mce:script>      
      8.     <mce:script language="javascript"><!--  
      9.     
      10.         $(document).ready(function() {    
      11.             function jump(count) {    
      12.                 window.setTimeout(function(){    
      13.                     count--;    
      14.                     if(count > 0) {    
      15.                         $('#num').attr('innerHTML', count);    
      16.                         jump(count);    
      17.                     } else {    
      18.                         location.href="login.jsp";    
      19.                     }    
      20.                 }, 1000);    
      21.             }    
      22.             jump(3);    
      23.         });    
      24.       
      25. // --></mce:script>    
      26.   </head>        
      27.   <body>      
      28.     <span style="color:red" mce_style="color:red">欢迎来到******!</span><br/>页面将在3秒后跳转...<br/>还剩<span id="num">3</span>秒  
      29.   </body>    
      30. </html>  
  • 相关阅读:
    Docker-常用命令
    5分钟了解折半插入排序
    Spring框架之IOC原理
    使用JS实现简单喷泉效果
    坦克大战系列6-API常用函数说明1
    坦克大战系列6-API常用函数说明2
    为什么要使用-Docker
    SQL语言:存储过程
    使用原生JS重构简单的音乐播放器
    [区间DP]ZOJ3541 The Last Puzzle
  • 原文地址:https://www.cnblogs.com/ZhuRenWang/p/4801384.html
Copyright © 2011-2022 走看看