- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
- <HTML>
- <HEAD>
- <TITLE>Jquery实现页面定时跳转</TITLE>
- <script language="javascript" type="text/javascript" src="jquery-1.4.2.min.js"></script>
- <script language="javascript">
- $(document).ready(function() {
- function jump(count) {
- window.setTimeout(function(){
- count--;
- if(count > 0) {
- $(‘#last‘).attr(‘innerHTML‘, count);
- jump(count);
- } else {
- location.href="http://www.baidu.com";
- }
- }, 1000);
- }
- jump(5);
- });
- </script>
- </HEAD>
- <BODY>
- <span id="last">5</span>秒后将跳转到百度首页!</div>
- </BODY>
- </HTML>
时间: 2024-11-10 14:04:35