Skip to content
/ nanobar Public
forked from jacoborus/nanobar

Very very lighweight progress bars. No jQuery required.

License

Notifications You must be signed in to change notification settings

t11e/nanobar

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nanobar

Very very lightweight progress bars (~730 bytes gzipped). No jQuery needed.

Compatibility: iE8+ and the rest of the world

Demo

See nanobar.micronube.com

Installation

Download and extract the last release from here or install with package manager:

Bower:

$ bower install nanobar

npm:

$ npm install nanobar

Usage

Load

Link nanobar.js from your html file

<script src="path/to/nanobar.js"></script>

or require it with Browserify:

var Nanobar = require('path/to/nanobar')

Generate progressbar

var nanobar = new Nanobar( options );

options

  • bg <String>: (optional) background css property, '#000' by default
  • id <String>: (optional) id for nanobar div
  • target <DOM Element>: (optional) Where to put the progress bar, nanobar will be fixed to top of document if target is null

Move bar

Resize the bar with nanobar.go(percentage)

arguments

  • percentage <Number> : percentage width of nanobar

Example

Create bar

var options = {
	bg: '#acf',
	// leave target blank for global nanobar
	target: document.getElementById('myDivId'),
	// id for new nanobar
	id: 'mynano'
};

var nanobar = new Nanobar( options );

//move bar
nanobar.go( 30 ); // size bar 30%

// Finish progress bar
nanobar.go(100);




© 2014 jacoborus - Released under MIT License

About

Very very lighweight progress bars. No jQuery required.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 58.2%
  • CSS 41.8%