jquery-ui 进度条功能示例【测试可用】

软件发布|下载排行|最新软件

当前位置:首页IT学院IT技术

jquery-ui 进度条功能示例【测试可用】

xshang   2020-05-17 我要评论

本文实例讲述了jquery-ui 进度条功能。分享给大家供大家参考,具体如下:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf8" />
<title>www.qb5200.com progressbar</title>
<style type="text/css">
  #divprogressbar{
  width:300px;
  height:30px;
  }
  .progress-label{
  float:left;
  margin-left:40%;
  margin-top:3px;
  }
</style>
<link rel="stylesheet" href="https://cdn.bootcss.com/jqueryui/1.11.0/jquery-ui.css" rel="external nofollow"  media="screen"/>
<script src="https://libs.baidu.com/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript" src="https://cdn.bootcss.com/jqueryui/1.10.4/jquery-ui.min.js"></script>
</head>
<body>
<div id="divprogressbar"><div class="progress-label">loading...</div></div>
<script type="text/javascript">
  $(function(){
   // var val=0;
    $('#divprogressbar').progressbar({value:0});
    $('#divprogressbar').progressbar({
      value:0,
      change:function(){
        $(".progress-label").text($("#divprogressbar").progressbar("value")+"%");
      },
      complete:function(){
        $(".progress-label").text("Complete!");
      }
    });
    function progress(){
    var val= $('#divprogressbar').progressbar("value") || 0;
    $('#divprogressbar').progressbar("option","value",val+1);
    if(val<99)
    {
    setTimeout(progress,100);
    }
    }
    setTimeout(progress,1000);
  }
 );
</script>
</body>
</html>

运行效果:

查看文档:http://jqueryui.com/progressbar/

希望本文所述对大家jQuery程序设计有所帮助。

Copyright 2022 版权所有 软件发布 访问手机版

声明:所有软件和文章来自软件开发商或者作者 如有异议 请与本站联系 联系我们