html定时跳转页面

前端开发   发布日期:2025年05月03日   浏览次数:193
  1. <!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"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><meta name="baidu-site-verification" content="ja4snz5Jr1" /><!--包含头文件--></head><style>
  2. p{
  3. font-size: 50px;
  4. height: 80px;
  5. position: fixed;
  6. top: 0px;
  7. bottom:0px;
  8. left: 0px;
  9. right: 0px;
  10. margin: auto;
  11. text-align: center;
  12. }
  13. #seconds{
  14. color: red;
  15. }
  16. *{
  17. margin: 0px;
  18. padding: 0px;
  19. }
  20. html,body{
  21. width: 100%;
  22. height: 100%;
  23. background: url("/cn/Index/Tpl//Public/images/bg5.jpg") no-repeat center;
  24. background-size: cover;
  25. }
  26. </style><body><p>请等待...<span id="seconds">60</span></p></body><script>
  27. var interval =window.setInterval("clock()",);
  28. var second = ;
  29. var a = parseInt(*Math.random());
  30. function clock(){
  31. if(second == a){
  32. window.clearInterval(interval);
  33. window.location.href="www.baidu.com";
  34. }else{
  35. second = second-
  36. document.getElementById("seconds").innerHTML = second;
  37. }
  38. }
  39. </script></html>

 

以上就是html定时跳转页面的详细内容,更多关于html定时跳转页面的资料请关注九品源码其它相关文章!