2012-11-30 04:12:30 +00:00
|
|
|
<!doctype html>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
2012-12-04 03:25:55 +00:00
|
|
|
<title>jQuery UI Progressbar - Custom Label</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-11-30 04:12:30 +00:00
|
|
|
<link rel="stylesheet" href="../demos.css">
|
|
|
|
<style>
|
2013-03-18 17:05:57 +00:00
|
|
|
.ui-progressbar {
|
|
|
|
position: relative;
|
|
|
|
}
|
2012-12-04 03:25:55 +00:00
|
|
|
.progress-label {
|
2013-03-18 17:05:57 +00:00
|
|
|
position: absolute;
|
|
|
|
left: 50%;
|
|
|
|
top: 4px;
|
2012-12-04 03:25:55 +00:00
|
|
|
font-weight: bold;
|
|
|
|
text-shadow: 1px 1px 0 #fff;
|
|
|
|
}
|
2012-11-30 04:12:30 +00:00
|
|
|
</style>
|
|
|
|
<script>
|
|
|
|
$(function() {
|
2012-12-04 03:25:55 +00:00
|
|
|
var progressbar = $( "#progressbar" ),
|
|
|
|
progressLabel = $( ".progress-label" );
|
|
|
|
|
|
|
|
progressbar.progressbar({
|
2012-11-30 04:12:30 +00:00
|
|
|
value: false,
|
2012-12-04 03:25:55 +00:00
|
|
|
change: function() {
|
|
|
|
progressLabel.text( progressbar.progressbar( "value" ) + "%" );
|
|
|
|
},
|
|
|
|
complete: function() {
|
|
|
|
progressLabel.text( "Complete!" );
|
2012-11-30 04:12:30 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
function progress() {
|
2012-12-04 03:25:55 +00:00
|
|
|
var val = progressbar.progressbar( "value" ) || 0;
|
2012-11-30 04:12:30 +00:00
|
|
|
|
2012-12-04 03:25:55 +00:00
|
|
|
progressbar.progressbar( "value", val + 1 );
|
|
|
|
|
|
|
|
if ( val < 99 ) {
|
|
|
|
setTimeout( progress, 100 );
|
2012-11-30 04:12:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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>
|