jQuery Progress Bar Plugin NUMBERPROGRESSBAR
Add-ons

Plugin Description: A cute progress bar. Inspired by daimajia.
Installation
1 | bower install NumberProgressBar [--save] |
Usage
HTML
1 2 3 4 | <div class="number-pb"> <div class="number-pb-shown"></div> <div class="number-pb-num">0%</div></div> |
CSS
You can refer to the number-pb.css file and customize it to suit your needs.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | .number-pb { position: relative; height: 3px; background-color: #ddd;}.number-pb .number-pb-shown { position: absolute; background-color: #176785; background-image: linear-gradient(to right, #176785, #499989); top: -1px; left: 0; height: 5px; -moz-box-shadow: 0 0 3px 0 #499989; -webkit-box-shadow: 0 0 3px 0 #499989; box-shadow: 0 0 3px 0 #499989;}.number-pb .number-pb-num { position: absolute; background-color: #fff; left: 0; top: -0.45em; padding: 0 5px; } |
javaScript
1 2 | var bars = $('.number-pb').NumberProgressBar(options);bars.reach(num); // num is the percentage you want to achieve |
Settings
OptionsDefaultUsage
duration10000Duration (in milliseconds) required to go from 0 to 100
percentage0Initial percentage
shownQuery'.number-pb-shown'Query string for the displayed bar
numQuery'.number-pb-num'Query string for the number
评论