jqueryui
Thursday, 26 February 2015
JqueryUI Progressbar
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>jQuery UI ProgressBar </title> <link href="http://code.jquery.com/ui/1.10.4/themes/ui-lightness/jquery-ui.css" rel="stylesheet"> <script src="http://code.jquery.com/jquery-1.10.2.js"></script> <script src="http://code.jquery.com/ui/1.10.4/jquery-ui.js"></script> <style> .ui-widget-header { background: #ffdcc4; border: 1px solid #333; color: #333333; font-weight: bold; } .progress-label { position: absolute; left: 50%; top: 13px; font-weight: bold; text-shadow: 1px 1px 0 #fff; } </style> <script> $(function() { var progressbar = $( "#progressbar-5" ); progressLabel = $( ".progress-label" ); $( "#progressbar-5" ).progressbar({ value: false, change: function() { progressLabel.text( progressbar.progressbar( "value" ) + "%" ); }, complete: function() { progressLabel.text( "Loading Completed!" ); } }); function progress() { var val = progressbar.progressbar( "value" ) || 0; progressbar.progressbar( "value", val + 1 ); if ( val < 99 ) { setTimeout( progress, 100 ); } } setTimeout( progress, 3000 ); }); </script> </head> <body> <div id="progressbar-5"> <div class="progress-label"> Loading... </div> </div> </body> </html>
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment