进度条,加载到百分比,出现不同的文字提示

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>简单的jquery进度条</title>
<script type="text/javascript" src="jquery.js"></script>
</head>
<body>
<script>
var i=0;
/*add——创建tbx下的div加文字和变宽度的方法*/
function add(i){
         var tbox =$(".tbox");
var tiao =$(".tiao");
            tiao.css("width",i+"%").html(i+"%");
        }
/*创建方法(i++循环起来)*/
    function xh(){
        if(i>100){
            $(".ok").html("正在跳转").fadeIn("slow");
            return;
            }
        else if(i>0 && i<10){
            $(".ok").html("正在验证登录权限").fadeIn("slow");
            setTimeout("xh()",200)
            add(i);
         i++;
            }
        else if(i>10 && i<20){
            $(".ok").html("正在验证菜单权限").fadeIn("slow");
            setTimeout("xh()",200)
            add(i);
         i++;
            }
        else if(i>20&&i<30){
            $(".ok").html("正在验证按钮权限").fadeIn("slow");
            setTimeout("xh()",200)
            add(i);
         i++;
            }
        else if(i>30&&i<40){
            $(".ok").html("正在加载基础框架").fadeIn("slow");
            setTimeout("xh()",200)
            add(i);
         i++;
            }
        else if(i>40&&i<50){
            $(".ok").html("正在加载基础控件").fadeIn("slow");
            setTimeout("xh()",200)
            add(i);
         i++;
            }
        else if(i>50&&i<60){
            $(".ok").html("正在同步用户数据").fadeIn("slow");
            setTimeout("xh()",200)
            add(i);
         i++;
            }
        else if(i>60&&i<70){
            $(".ok").html("正在同步项目数据").fadeIn("slow");
            setTimeout("xh()",200)
            add(i);
         i++;
            }
        else if(i>70&&i<90){
            $(".ok").html("正在同步配件数据").fadeIn("slow");
            setTimeout("xh()",300)
            add(i);
         i++;
            }
        else if(i<=100){
            setTimeout("xh()",300)
            add(i);
         i++;
            }
        }
        
/*调用xh()函数*/
    $(document).ready(function(){   
        xh();
    });
</script>
<style>
    .clearfix:after {
content: " ";
display: block;
clear: both;
height: 0;
}
.clearfix {
zoom: 1;
}
.box{width:100%; height:100%; margin:0 auto; }
.ok{width:200px; height:100px; margin:0 auto; text-align:center; line-height:100px; color:#666; display:none; }
.tbox{width:397px; height:30px; background:rgba(236, 236, 236, 0.867); margin:0 auto;margin-top:24%;}
.tbox div{width:0px; height:30px; background:#e8e8e8; text-align:center;
font-family:Tahoma; font-size:18px; line-height:30px;color:#666;}
</style>
<div class="box">
    
<div class="tbox">
<div class="tiao"></div>
    </div>
    <div class="ok"></div>  
</div>
</body>
</html>


转载于:https://www.cnblogs.com/caihuan99/p/9681576.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值