progressbar interactions for twitter bootstrap 2 & 3
npm install bootstrap-progressbarbootstrap-progressbar is a jQuery plugin which extends the basic twitter-bootstrap progressbar. It provides the ability to animate the progressbar by adding Javascript in combination with the preexisting css transitions. Additionally you can display the current progress information in the bar or get the value via callback.
* Fix #49 runtime option override support
* Fix #48 extend bower.json
> __Note__: this version replaces the not official supported aria-valuetransitionsgoal with data-transitionsgoal which may affect (or brick) your progressbars.
> __Note__: Bootstrap's low percentage styles (introduced in 3.2.0) causes flickering under some circumstances (e.g. slow transitions). To preserve correct progressbar functionality + appearance this bs feature is reverted in v0.8.3. (and reverted by bootstrap in 3.3.0)
> __Note__: Stacked progressbars are not supported by now.
* http://www.minddust.com/project/bootstrap-progressbar/demo/
* Download the latest release: v0.9.0
* Clone the repository: git clone git@github.com:minddust/bootstrap-progressbar.git
* Install with Bower: bower install bootstrap-progressbar
1. include bootstrap-progressbar.js
``html`
2. activate bootstrap-progressbar functionality on progressbars of your choice:
`javascript`
$('.progress .bar').progressbar(); // bootstrap 2
$('.progress .progress-bar').progressbar(); // bootstrap 3
3. set the aria attribute and __remove__ the width style attribute (alternatively you can set it to 0)
1. data-transitiongoal
`html`
2. aria-valuemin (default: 0) and aria-valuemax (default: 100)
`html`
* Do I need the additional style file?
* for the horizontal bar with no or filled text: __NO__
* for any vertical bars or the horizontal bar with centered text or right aligned bar: __YES__
less:
`html`
or precompile it yourself. (see: 3rd party compilers)
scss:
* need to precompile it yourself (see: libsass)
css:
`html`
you can find your needed css, less or scss files inside the specific subdirectories.
* Multiple trigger
You can trigger progressbar as much as you want. Just change your attribute(s) and trigger .progressbar() again. All settings made before will be kept.
`javascript`
Progressbar.defaults = {
transition_delay: 300,
refresh_speed: 50,
display_text: 'none',
use_percentage: true,
percent_format: function(percent) { return percent + '%'; },
amount_format: function(amount_part, amount_total) { return amount_part + ' / ' + amount_total; },
update: $.noop,
done: $.noop,
fail: $.noop
};
Is the time in milliseconds until the animation starts.
This could be useful to delay the start on the initial page load like:
`javascript`
$(document).ready(function() {
$('.progress .progress-bar').progressbar({
transition_delay: 1500
});
});
Is the time in milliseconds which will elapse between every text refresh, aria-valuenow attribute update and update callback call.
Determines if and where to display text on the progressbar. Possible options:
* none __no text__fill
* __text on filled bar__center
__text on center__ (this mode changes css / html due to styling requirements)*
If text will be displayed - this option determines whether to show the percentage value or the amount.
So if use_percentage is false and aria-valuemin and aria-valuemax are not set (or to 0 and 100) the value will be the same but amount_format will be used to format the result.
Example: