This time I will share jQuery Plugin and tutorial about jQuery Plugin To Create Animated Gradient Progress Bars, hope it will help you in programming stack.
A lightweight and simple-to-use jQuery plugin which lets you generate animated, canvas
based progress bars with custom gradient fills. Inspired by the jQuery Circle Progress plugin.
How to use it:
1. Make sure you have jQuery library and the jQuery Gradient Progress Bar loaded in your document.
1 |
< script src = "//code.jquery.com/jquery-2.1.4.min.js" ></ script > |
2 |
< script src = "gradient-progress-bar.min.js" ></ script > |
2. Create a DIV element that will be served as the container for your progress bar.
1 |
< div class = "progress-bar" ></ div > |
3. Call the plugin to render an animated progress bar with a preset gradient fill into the DIV element you just created.
1 |
$( '.progress-bar' ).gradientProgressBar({ |
5 |
gradient: [ "green" , "yellow" , "red" ] |
4. All default options which can be used to customize the progress bars.
20 |
* Fill of the bar. You may set it to: |
22 |
* - { color: ' #3aeabb' } |
23 |
* - { color: 'rgba(255, 255, 255, .3) ' } |
24 |
* - linear gradient (left to right): |
25 |
* - { gradient: [' #3aeabb', '#fdd250'], gradientAngle: Math.PI / 4 } |
26 |
* - { gradient: ['red ', ' green ', ' blue '], gradientDirection: [x0, y0, x1, y1] } |
29 |
gradient: [' #3aeabb', '#fdd250'] |
36 |
emptyFill: 'rgba(0, 0, 0, .1) ', |
43 |
easing: ' gradientProgressBarEasing ' |
47 |
* Default animation starts at 0.0 and ends at specified value . Let' s call this direct animation. |
48 |
* Also you may specify any other value from 0.0 to 1.0 |
51 |
animationStartValue: 0.0, |
Change log:
2015-09-09
- Fixed calculation of the start point of the progress bar when the lineCap is round
This awesome jQuery plugin is developed by lgrassini. For more Advanced Usages, please check the demo page or visit the official website.