aboutsummaryrefslogtreecommitdiffstats
path: root/demos/progressbar
diff options
context:
space:
mode:
Diffstat (limited to 'demos/progressbar')
-rw-r--r--demos/progressbar/animated.html34
-rw-r--r--demos/progressbar/indeterminate.html16
-rw-r--r--demos/progressbar/index.html3
-rw-r--r--demos/progressbar/label.html58
-rw-r--r--demos/progressbar/resize.html33
5 files changed, 67 insertions, 77 deletions
diff --git a/demos/progressbar/animated.html b/demos/progressbar/animated.html
deleted file mode 100644
index 5cb1872ed..000000000
--- a/demos/progressbar/animated.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
- <meta charset="utf-8">
- <title>jQuery UI Progressbar - Animated</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: 59
- }).find( ".ui-progressbar-value div" ).addClass( "ui-progressbar-overlay" );
- });
- </script>
-</head>
-<body>
-
-<div id="progressbar"></div>
-
-<div class="demo-description">
-<p>
-This progressbar has an animated fill by setting the
-<code>ui-progressbar-overlay</code> class
-on the
-<code>.ui-progressbar-value</code>
-element's overlay div.
-</p>
-</div>
-</body>
-</html>
diff --git a/demos/progressbar/indeterminate.html b/demos/progressbar/indeterminate.html
index 34ce6da47..b07211496 100644
--- a/demos/progressbar/indeterminate.html
+++ b/demos/progressbar/indeterminate.html
@@ -16,27 +16,27 @@
});
$( "button" ).on( "click", function( event ) {
var target = $( event.target ),
- pbar = $( "#progressbar" ),
- pbarValue = pbar.find( ".ui-progressbar-value" );
+ progressbar = $( "#progressbar" ),
+ progressbarValue = progressbar.find( ".ui-progressbar-value" );
if ( target.is( "#numButton" ) ) {
- pbar.progressbar( "option", {
+ progressbar.progressbar( "option", {
value: Math.floor( Math.random() * 100 )
});
} else if ( target.is( "#colorButton" ) ) {
- pbarValue.css({
+ progressbarValue.css({
"background": '#' + Math.floor( Math.random() * 16777215 ).toString( 16 )
});
} else if ( target.is( "#falseButton" ) ) {
- pbar.progressbar( "option", "value", false );
+ progressbar.progressbar( "option", "value", false );
}
});
});
</script>
<style>
- #progressbar .ui-progressbar-value {
- background-color: #CCCCCC;
- }
+ #progressbar .ui-progressbar-value {
+ background-color: #ccc;
+ }
</style>
</head>
<body>
diff --git a/demos/progressbar/index.html b/demos/progressbar/index.html
index df3483816..cfc054aea 100644
--- a/demos/progressbar/index.html
+++ b/demos/progressbar/index.html
@@ -8,9 +8,8 @@
<ul>
<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>
+ <li><a href="label.html">Custom Labels</a></li>
</ul>
</body>
diff --git a/demos/progressbar/label.html b/demos/progressbar/label.html
new file mode 100644
index 000000000..25394b205
--- /dev/null
+++ b/demos/progressbar/label.html
@@ -0,0 +1,58 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Progressbar - Custom Label</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">
+ <style>
+ .progress-label {
+ float: left;
+ margin-left: 50%;
+ margin-top: 5px;
+ 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( "Complete!" );
+ }
+ });
+
+ 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">Loading...</div></div>
+
+<div class="demo-description">
+<p>Custom updated label demo.</p>
+</div>
+</body>
+</html>
diff --git a/demos/progressbar/resize.html b/demos/progressbar/resize.html
deleted file mode 100644
index eac40c0c0..000000000
--- a/demos/progressbar/resize.html
+++ /dev/null
@@ -1,33 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
- <meta charset="utf-8">
- <title>jQuery UI Progressbar - Resizable</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.mouse.js"></script>
- <script src="../../ui/jquery.ui.progressbar.js"></script>
- <script src="../../ui/jquery.ui.resizable.js"></script>
- <link rel="stylesheet" href="../demos.css">
- <script>
- $(function() {
- $( "#progressbar" ).progressbar({
- value: 37
- });
- $( "#progressbarWrapper" ).resizable();
- });
- </script>
-</head>
-<body>
-
-<div id="progressbarWrapper" style="height:30px; " class="ui-widget-default">
- <div id="progressbar" style="height:100%;"></div>
-</div>
-
-<div class="demo-description">
-<p>The progress bar's widths are specified in percentages for flexible sizing so it will resize to fit its container. Try resizing the height and width of this bar to see how it maintains the correct proportions. (This is not necessarily a real-world example, but it's a good illustration of how flexibly all the plugins are coded.)</p>
-</div>
-</body>
-</html>