zoukankan      html  css  js  c++  java
  • 加载等待并跳转页面

    <!DOCTYPE html>
    <html>
    <head>
        <meta charset="UTF-8">
        <title></title>
    </head>
    <body>
        <form name=loading>
            <p>
                <!--进度条加载时上面那行的提示-->
                <font color="#0066ff" size="2" face="Arial">载入中,请稍等...</font><br>
                <!--进度条-->
                <input type=text name=chart size=46 style="font-family:Arial; font-weight:bolder; color:#0066ff; padding:0px; border-style:none;">
                <br>
                <!--进度条加载的进度-->
                <input type=text name=percent size=47 style="color:#0066ff; text-align:center; border-medium; border-style:none;">
            </p>
        </form>
    </body>
    </html>
    <script>
        var bar = 0; //初始变量的值
        var line = "||"; //定义的进度条
        var amount = "||"; //定义的进度条
        count();
        function count(){
            bar = bar + 2; //变量每次加2
            amount = amount + line; //两个进度条进行的拼接
            document.loading.chart.value = amount; //进度条
            document.loading.percent.value = bar + "%"; //进度条显示的进度,也是拼接
                if(bar < 99){
                    setTimeout("count()", 100); //只要变量小于99,每100毫秒循环调用一次
                } else{
                    window.location = "夜空下的星星.html"; //进度条加载完成(100%时)跳转页面
                }
        }
    </script>
  • 相关阅读:
    在新浪爱问上看到的有趣名字都记下来
    FastReports_4.14.1 _Cliff手动安装
    计算机算法对做事效率的启发(既要高强度猛攻,也要细水长流)
    有趣的数组
    listView 分页加载数据
    如何隐藏Cognos Viewer
    使用DBUnit实现对数据库的测试
    通过Jasmine和Guard自动测试JavaScript
    for惠普2013实习生
    栈的顺序存储,所谓的顺序栈
  • 原文地址:https://www.cnblogs.com/tis100204/p/10328880.html
Copyright © 2011-2022 走看看