Skip to content

Instantly share code, notes, and snippets.

@kborchers
Created December 4, 2012 02:27
Show Gist options
  • Save kborchers/4199953 to your computer and use it in GitHub Desktop.
Save kborchers/4199953 to your computer and use it in GitHub Desktop.
$(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" );
if ( !val ) {
val = 0;
}
progressbar.progressbar( "value", val + 1 );
if ( val >= 100 ) {
return;
} else {
setTimeout( progress, 100 );
}
}
setTimeout( progress, 3000 );
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment