Very lightweight progress bars (~699 bytes gzipped).
Compatibility: iE7+ and the rest of the world
Demo
Installation
Download and extract the latest release or install with package manager:
$ bower install nanobar
npm:
$ npm install nanobar
Usage
Load
Link nanobar.js
from your html file
or require it:
var Nanobar = ;
Generate progressbar
var nanobar = options ;
options
id
<String>
: (optional) id for nanobar divclassname
<String>
: (optional) class for nanobar divtarget
<DOM Element>
: (optional) Where to put the progress bar, nanobar will be fixed to top of document if notarget
is passed
Move bar
Resize the bar with nanobar.go(percentage)
arguments
percentage
<Number>
: percentage width of nanobar
Example
Create bar
var options = classname: 'my-class' id: 'my-id' target: document; var nanobar = options ; //move barnanobar; // size bar 30%nanobar; // size bar 76% // size bar 100% and and finishnanobar;
Customize bars
Nanobar injects a style tag in your HTML head. Bar divs has class .bar
, and its containers .nanobar
, so you can overwrite its values.
Default css:
You should know what to do with that ;)
© 2016 jacoborus - Released under MIT License