>>分享Web前端开发技术,并对孙卫琴的《精通Vue.js:Web前端开发技术详解》提供技术支持 书籍支持  卫琴直播  品书摘要  在线测试  资源下载  联系我们
发表一个新主题 开启一个新投票 回复文章 您是本文章第 29741 个阅读者 刷新本主题
 * 贴子主题:  jQuery UI范例: 进度条(Progressbar) 回复文章 点赞(0)  收藏  
作者:flybird    发表时间:2019-08-18 12:30:07     消息  查看  搜索  好友  邮件  复制  引用

  

jQuery UI 范例 -  进度条(Progressbar)

    显示一个确定的或不确定的进程状态。                    

默认功能

     默认的确定的进度条。


<!doctype html>

<html lang="en">

<head>

  <meta charset="utf-8">

  <title>jQuery UI 进度条(Progressbar) - 默认功能</title>

  <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">

  <script src="//code.jquery.com/jquery-1.9.1.js"></script>

  <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>

  <link rel="stylesheet" href="http://jqueryui.com/resources/demos/style.css">

  <script>

  $(function() {

    $( "#progressbar" ).progressbar({

      value: 37

    });

  });

  </script>

</head>

<body>

         <div id="progressbar"></div>

</body>

</html>

自定义标签

     自定义更新的标签。


<!doctype html>

<html lang="en">

<head>

  <meta charset="utf-8">

  <title>jQuery UI 进度条(Progressbar) - 自定义标签</title>

  <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">

  <script src="//code.jquery.com/jquery-1.9.1.js"></script>

  <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>

  <link rel="stylesheet" href="http://jqueryui.com/resources/demos/style.css">

  <style>

  .ui-progressbar {

    position: relative;

  }

  .progress-label {

    position: absolute;

    left: 50%;

    top: 4px;

    font-weight: bold;

    text-shadow: 1px 1px 0 #fff;

  }

  </style>

  <script>

  $(function() {

    var progressbar = $( "#progressbar" ),

      progressLabel = $( ".progress-label" );

             progressbar.progressbar({

      value: false,

      change: function() {

        progressLabel.text( progressbar.progressbar( "value" ) + "%" );

      },

      complete: function() {

        progressLabel.text( "完成!" );

      }

    });

    function progress() {

      var val = progressbar.progressbar( "value" ) || 0;

               progressbar.progressbar( "value", val + 1 );

               if ( val < 99 ) {

        setTimeout( progress, 100 );

      }

    }

             setTimeout( progress, 3000 );

  });

  </script>

</head>

<body>

         <div id="progressbar"><div class="progress-label">加载...</div></div>

</body>

</html>

不确定的值

     不确定的进度条,并可在确定和不确定的样式之间切换。


<!doctype html>

<html lang="en">

<head>

  <meta charset="utf-8">

  <title>jQuery UI 进度条(Progressbar) - 不确定的值</title>

  <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">

  <script src="//code.jquery.com/jquery-1.9.1.js"></script>

  <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>

  <link rel="stylesheet" href="http://jqueryui.com/resources/demos/style.css">

  <script>

  $(function() {

    $( "#progressbar" ).progressbar({

      value: false

    });

    $( "button" ).on( "click", function( event ) {

      var target = $( event.target ),

        progressbar = $( "#progressbar" ),

        progressbarValue = progressbar.find( ".ui-progressbar-value" );

      if ( target.is( "#numButton" ) ) {

        progressbar.progressbar( "option", {

          value: Math.floor( Math.random() * 100 )

        });

      } else if ( target.is( "#colorButton" ) ) {

        progressbarValue.css({

          "background": '#' + Math.floor( Math.random() * 16777215 ).toString( 16 )

        });

      } else if ( target.is( "#falseButton" ) ) {

        progressbar.progressbar( "option", "value", false );

      }

    });

  });

  </script>

  <style>

  #progressbar .ui-progressbar-value {

    background-color: #ccc;

  }

  </style>

</head>

<body>

         <div id="progressbar"></div>

<button id="numButton">随机值 - 确定</button>

<button id="falseButton">不确定</button>

<button id="colorButton">随机颜色</button>

</body>

</html>

程序猿的技术大观园:www.javathinker.net



[这个贴子最后由 flybird 在 2020-02-16 09:47:54 重新编辑]
  Java面向对象编程-->接口
  JavaWeb开发-->访问数据库(Ⅰ)
  JSP与Hibernate开发-->通过JPA API检索数据
  Java网络编程-->RMI框架
  精通Spring-->Vue组件开发基础
  Vue3开发-->Vue CLI脚手架工具
  webpack常用插件
  vue3.0-基本特性和用法
  本以为精通Vue,没想到被前阿里大佬虐哭了......
  Vue中qs插件的使用
  基于vue和springmvc前后端分离,json类接口调用介绍
  HTML DOM Li 对象
  HTML DOM Image图片对象
  Javascript DOM封装方法汇总
  CSS3 多列布局
  HTML支持的多媒体(Media)
  HTML5 内联 SVG
  JavaScript HTML DOM 节点列表
  JavaScript 对象 的创建和使用
  JavaScript 语法大全
  用JavaScript制作弹出页面
  更多...
 IPIP: 已设置保密
楼主      
1页 0条记录 当前第1
发表一个新主题 开启一个新投票 回复文章


中文版权所有: JavaThinker技术网站 Copyright 2016-2026 沪ICP备16029593号-2
荟萃Java程序员智慧的结晶,分享交流Java前沿技术。  联系我们
如有技术文章涉及侵权,请与本站管理员联系。