- Overview
- Documents
jQuery Progress timer is a jquery extension that extends the functionality of the Bootstrap progress bar component
- REQUIRES Bootstrap 3.2.0 or greater.
Source: github.com
Oct 14, 2014 in Animation 4930 views
jQuery Progress timer is a jquery extension that extends the functionality of the Bootstrap progress bar component
Source: github.com
1. INCLUDE JS FILES
<script src="js/static.min.js"></script> <script src="../dist/js/jquery.progresstimer.js"></script>
2. HTML
<div class="container"> <div class="loading-progress"></div> </div>
3. JAVASCRIPT
var progress = $(".loading-progress").progressTimer({ timeLimit: 10, onFinish: function () { alert('completed!'); } }); $.ajax({ url:"http://localhost/" }).error(function(){ progress.progressTimer('error', { errorText:'ERROR!', onFinish:function(){ alert('There was an error processing your information!'); } }); }).done(function(){ progress.progressTimer('complete'); });
4. OPTIONS
//total number of seconds timeLimit: 60, //seconds remaining triggering switch to warning color warningThreshold: 5, //invoked once the timer expires onFinish: function () { }, //bootstrap progress bar style at the beginning of the timer baseStyle: '', //bootstrap progress bar style in the warning phase warningStyle: 'progress-bar-danger', //bootstrap progress bar style at completion of timer completeStyle: 'progress-bar-success', //show html on progress bar div area showHtmlSpan: true, //set the error text when error occurs errorText: 'ERROR!'
Tagged with:
progress timer
jquery progress
jquery extension
bootstrap progress
jquery progress timer
progress bar
bootstrap
Related Articles