2012-03-27 02:51:16 +00:00
|
|
|
<!doctype html>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<title>jQuery UI Progressbar - Indeterminate Value</title>
|
2013-12-02 18:36:12 +00:00
|
|
|
<link rel="stylesheet" href="../../themes/base/all.css">
|
2013-06-01 19:25:27 +00:00
|
|
|
<script src="../../jquery-1.10.2.js"></script>
|
2013-12-02 18:36:12 +00:00
|
|
|
<script src="../../ui/core.js"></script>
|
|
|
|
<script src="../../ui/widget.js"></script>
|
|
|
|
<script src="../../ui/progressbar.js"></script>
|
2012-03-27 02:51:16 +00:00
|
|
|
<link rel="stylesheet" href="../demos.css">
|
|
|
|
<script>
|
|
|
|
$(function() {
|
|
|
|
$( "#progressbar" ).progressbar({
|
|
|
|
value: false
|
|
|
|
});
|
|
|
|
$( "button" ).on( "click", function( event ) {
|
|
|
|
var target = $( event.target ),
|
2012-11-29 17:06:22 +00:00
|
|
|
progressbar = $( "#progressbar" ),
|
|
|
|
progressbarValue = progressbar.find( ".ui-progressbar-value" );
|
2012-03-27 02:51:16 +00:00
|
|
|
|
|
|
|
if ( target.is( "#numButton" ) ) {
|
2012-11-29 17:06:22 +00:00
|
|
|
progressbar.progressbar( "option", {
|
2012-03-27 02:51:16 +00:00
|
|
|
value: Math.floor( Math.random() * 100 )
|
|
|
|
});
|
|
|
|
} else if ( target.is( "#colorButton" ) ) {
|
2012-11-29 17:06:22 +00:00
|
|
|
progressbarValue.css({
|
2012-03-27 02:51:16 +00:00
|
|
|
"background": '#' + Math.floor( Math.random() * 16777215 ).toString( 16 )
|
|
|
|
});
|
|
|
|
} else if ( target.is( "#falseButton" ) ) {
|
2012-11-29 17:06:22 +00:00
|
|
|
progressbar.progressbar( "option", "value", false );
|
2012-03-27 02:51:16 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
<style>
|
2012-11-29 17:06:22 +00:00
|
|
|
#progressbar .ui-progressbar-value {
|
|
|
|
background-color: #ccc;
|
|
|
|
}
|
2012-03-27 02:51:16 +00:00
|
|
|
</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>
|