Jquery几秒自动跳转

  1.  $(document).ready(function() {    
  2.             function jump(count) {    
  3.                 window.setTimeout(function(){    
  4.                     count--;    
  5.                     if(count > 0) {    
  6.                         $('#num').attr('innerHTML', count);    
  7.                         jump(count);    
  8.                     } else {    
  9.                         location.href="login.jsp";    
  10.                     }    
  11.                 }, 1000);    
  12.             }    
  13.             jump(3);    
  14.         });    
posted @ 2016-03-04 16:10  伏允坤  阅读(4002)  评论(0编辑  收藏  举报