5 <title>jQuery UI Progressbar - Indeterminate Value</title>
6 <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
7 <script src="../../jquery-1.9.1.js"></script>
8 <script src="../../ui/jquery.ui.core.js"></script>
9 <script src="../../ui/jquery.ui.widget.js"></script>
10 <script src="../../ui/jquery.ui.progressbar.js"></script>
11 <link rel="stylesheet" href="../demos.css">
14 $( "#progressbar" ).progressbar({
17 $( "button" ).on( "click", function( event ) {
18 var target = $( event.target ),
19 progressbar = $( "#progressbar" ),
20 progressbarValue = progressbar.find( ".ui-progressbar-value" );
22 if ( target.is( "#numButton" ) ) {
23 progressbar.progressbar( "option", {
24 value: Math.floor( Math.random() * 100 )
26 } else if ( target.is( "#colorButton" ) ) {
27 progressbarValue.css({
28 "background": '#' + Math.floor( Math.random() * 16777215 ).toString( 16 )
30 } else if ( target.is( "#falseButton" ) ) {
31 progressbar.progressbar( "option", "value", false );
37 #progressbar .ui-progressbar-value {
38 background-color: #ccc;
44 <div id="progressbar"></div>
45 <button id="numButton">Random Value - Determinate</button>
46 <button id="falseButton">Indeterminate</button>
47 <button id="colorButton">Random Color</button>
49 <div class="demo-description">
50 <p>Indeterminate progress bar and switching between determinate and indeterminate styles.</p>