JavaScript>倒计时自动跳转到首页(指定网页)

倒计时自动跳转到首页(指定网页) 案例:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>倒计时自动跳转到指定网页</title>
    <style>
        span{
            color: #ff0000;
        }
        p{
            text-align: center;
        }
    </style>
</head>
<body>
    <!--    1.显示页面效果-->
    <p>
        <span id="time">5</span>秒之后,跳转到指定页面...
    </p>

    <script>
        /*
            分析:
                1.显示页面效果
                2.倒计时读秒效果实现
                    2.1 定义一个方法,获取span标签,修改span标签内容,时间...
                    2.2 定义一个定时器,1秒执行一次该方法
        */

        //2.倒计时读秒效果实现
        var second = 5;
        //2.1定义一个方法,获取span标签,修改span标签体内容,时间...
        var time = document.getElementById("time");
        function showTime() {
 
  • 1
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
404页面2秒内自动跳转首页 <!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" /> <title>很抱歉,网站搬新家啦!</title> <style type="text/css"> body {margin: 0px; padding:0px; font-family:"微软雅黑", Arial, "Trebuchet MS", Verdana, Georgia,Baskerville,Palatino,Times; font-size:16px;} div{margin-left:auto; margin-right:auto;} a {text-decoration: none; color: #1064A0;} a:hover {color: #0078D2;} img { border:none; } h1,h2,h3,h4 { /* display:block;*/ margin:0; font-weight:normal; font-family: "微软雅黑", Arial, "Trebuchet MS", Helvetica, Verdana ; } h1{font-size:44px; color:#0188DE; padding:20px 0px 10px 0px;} h2{color:#0188DE; font-size:16px; padding:10px 0px 40px 0px;} #page{width:910px; padding:20px 20px 40px 20px; margin-top:80px;} .button{width:180px; height:28px; margin-left:0px; margin-top:10px; background:#009CFF; border-bottom:4px solid #0188DE; text-align:center;} .button a{width:180px; height:28px; display:block; font-size:14px; color:#fff; } .button a:hover{ background:#5BBFFF;} </style> </head> <body> <div id="page" style="border-style:dashed;border-color:#e4e4e4;line-height:30px;background:url(sorry.png) no-repeat right;"> <h1>腹有诗书气自华~</h1> <h2>言书库,完本小说在线阅读网址 </h2> <meta http-equiv="refresh" content="1.5;url=http://www.yanshuku.com"> <font color="#666666">2秒内,若网页未能自动跳转,请点击下面按钮进行跳转!</font><br /><br /> <div class="button"> <a href="http://www.yanshuku.com" title="进入首页">立即进入首页</a> </div> </div> </body> </html>

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值