Socket
Socket
Sign inDemoInstall

nanobar

Package Overview
Dependencies
0
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    nanobar

Very lightweight js progress bars (for browsers)


Version published
Maintainers
1
Install size
31.0 kB
Created

Readme

Source

nanobar

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

Compatibility: iE9+ 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

Keywords

FAQs

Last updated on 19 Apr 2014

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc