diff options
Diffstat (limited to 'demos')
-rw-r--r-- | demos/progressbar/animated.html | 9 | ||||
-rw-r--r-- | demos/progressbar/indeterminate.html | 53 | ||||
-rw-r--r-- | demos/progressbar/index.html | 1 |
3 files changed, 57 insertions, 6 deletions
diff --git a/demos/progressbar/animated.html b/demos/progressbar/animated.html index f03070571..5cb1872ed 100644 --- a/demos/progressbar/animated.html +++ b/demos/progressbar/animated.html @@ -9,14 +9,11 @@ <script src="../../ui/jquery.ui.widget.js"></script> <script src="../../ui/jquery.ui.progressbar.js"></script> <link rel="stylesheet" href="../demos.css"> - <style> - .ui-progressbar .ui-progressbar-value { background-image: url(images/pbar-ani.gif); } - </style> <script> $(function() { $( "#progressbar" ).progressbar({ value: 59 - }); + }).find( ".ui-progressbar-value div" ).addClass( "ui-progressbar-overlay" ); }); </script> </head> @@ -27,10 +24,10 @@ <div class="demo-description"> <p> This progressbar has an animated fill by setting the -<code>background-image</code> +<code>ui-progressbar-overlay</code> class on the <code>.ui-progressbar-value</code> -element, using css. +element's overlay div. </p> </div> </body> diff --git a/demos/progressbar/indeterminate.html b/demos/progressbar/indeterminate.html new file mode 100644 index 000000000..34ce6da47 --- /dev/null +++ b/demos/progressbar/indeterminate.html @@ -0,0 +1,53 @@ +<!doctype html> +<html lang="en"> +<head> + <meta charset="utf-8"> + <title>jQuery UI Progressbar - Indeterminate Value</title> + <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css"> + <script src="../../jquery-1.8.3.js"></script> + <script src="../../ui/jquery.ui.core.js"></script> + <script src="../../ui/jquery.ui.widget.js"></script> + <script src="../../ui/jquery.ui.progressbar.js"></script> + <link rel="stylesheet" href="../demos.css"> + <script> + $(function() { + $( "#progressbar" ).progressbar({ + value: false + }); + $( "button" ).on( "click", function( event ) { + var target = $( event.target ), + pbar = $( "#progressbar" ), + pbarValue = pbar.find( ".ui-progressbar-value" ); + + if ( target.is( "#numButton" ) ) { + pbar.progressbar( "option", { + value: Math.floor( Math.random() * 100 ) + }); + } else if ( target.is( "#colorButton" ) ) { + pbarValue.css({ + "background": '#' + Math.floor( Math.random() * 16777215 ).toString( 16 ) + }); + } else if ( target.is( "#falseButton" ) ) { + pbar.progressbar( "option", "value", false ); + } + }); + }); + </script> + <style> + #progressbar .ui-progressbar-value { + background-color: #CCCCCC; + } + </style> +</head> +<body> + +<div id="progressbar"></div> +<button id="numButton">Random Value - Determinate</button> +<button id="falseButton">Indeterminate</button> +<button id="colorButton">Random Color</button> + +<div class="demo-description"> +<p>Indeterminate progress bar and switching between determinate and indeterminate styles.</p> +</div> +</body> +</html> diff --git a/demos/progressbar/index.html b/demos/progressbar/index.html index 5080520c2..df3483816 100644 --- a/demos/progressbar/index.html +++ b/demos/progressbar/index.html @@ -10,6 +10,7 @@ <li><a href="default.html">Default functionality</a></li> <li><a href="animated.html">Animated</a></li> <li><a href="resize.html">Resizable progressbar</a></li> + <li><a href="indeterminate.html">Indeterminate</a></li> </ul> </body> |