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">
|
2014-06-10 11:55:45 +00:00
|
|
|
<script src="../../external/jquery/jquery.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
|
|
|
|
2014-04-24 17:52:47 +00:00
|
|
|
progressbar.progressbar( "value", val + 2 );
|
2012-12-04 03:25:55 +00:00
|
|
|
|
|
|
|
if ( val < 99 ) {
|
2014-04-24 17:52:47 +00:00
|
|
|
setTimeout( progress, 80 );
|
2012-11-30 04:12:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-04-24 17:52:47 +00:00
|
|
|
setTimeout( progress, 2000 );
|
2012-11-30 04:12:30 +00:00
|
|
|
});
|
|
|
|
</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>
|