案例:jQuery UI案例     状态:可编辑再运行    进入横版
AخA
          "background": '#' + Math.floor( Math.random() * 16777215 ).toString( 16 )
 
1
<!doctype html>
2
<html lang="en">
3
<head>
4
  <meta charset="utf-8">
5
  <title>jQuery UI 进度条(Progressbar) - 不确定的值</title>
6
  <link rel="stylesheet" href="/css/jqu1.10.4/jquery-ui.min.css">
7
  <script src="/js/jqu/jquery.min1.10.2.js"></script>
8
  <script src="/js/jqu/jquery-ui.min1.10.4.js"></script>
9
  <link rel="stylesheet" href="jqueryui/style.css">
10
  <script>
11
  $(function() {
12
    $( "#progressbar" ).progressbar({
13
      value: false
14
    });
15
    $( "button" ).on( "click", function( event ) {
16
      var target = $( event.target ),
17
        progressbar = $( "#progressbar" ),
18
        progressbarValue = progressbar.find( ".ui-progressbar-value" );
19
 
20
      if ( target.is( "#numButton" ) ) {
21
        progressbar.progressbar( "option", {
22
          value: Math.floor( Math.random() * 100 )
23
        });
24
      } else if ( target.is( "#colorButton" ) ) {

 运行结果 
 北美留学生论坛