jquery-ui/demos/progressbar/label.html

62 lines
1.3 KiB
HTML
Raw Normal View History

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>
2012-11-30 04:12:30 +00:00
<link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
2013-02-05 13:47:59 +00:00
<script src="../../jquery-1.9.1.js"></script>
2012-11-30 04:12:30 +00:00
<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>
.ui-progressbar {
position: relative;
}
2012-12-04 03:25:55 +00:00
.progress-label {
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>