Dependency free load progress bars
Download and extract the last release from here or install with Bower
$ bower install top-loader
Link top-loader.js
from your html file
<script src="path/to/top-loader.js"></script>
var toploader = new TopLoader( options );
options
bg
<String>
: background css property, '#acf' by defaultglow
<String>
: glow color (hexadecimal)
Initialize style and progress
Close the progress bar and launch ok symbol if passed as argument
arguments
ok
<Boolean>
: optional, if true show 'ok' symbol, if false shows 'error' symbol
Size the bar
arguments
percentage
<Number>
: percentage progress for bar
Create bar
var options = {
background: '#acf',
glow: '#acf'
};
var topLoader = new TopLoader( options );
move bar
topLoader.init();
topLoader.go( 30 ); // size bar 30%
Finish progress bar and launch ok symbol
topLoader.finish( true );
© 2014 jacoborus
Released under MIT License