Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Very lightweight progress bars. No jQuery

License

NotificationsYou must be signed in to change notification settings

jacoborus/nanobar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nanobar

Very lightweight progress bars (~699 bytes gzipped).

Compatibility: iE7+ and the rest of the world

npm versionBower version

Demo

Seenanobar.jacoborus.codes

Installation

Download and extract thelatest release or install with package manager:

Bower:

$ bower install nanobar

npm:

$ npm install nanobar

Usage

Load

Linknanobar.js from your html file

<scriptsrc="path/to/nanobar.min.js"></script>

or require it:

varNanobar=require('path/to/nanobar');

Generate progressbar

varnanobar=newNanobar(options);

options

  • id<String>: (optional) id fornanobar div
  • classname<String>: (optional) class fornanobar div
  • target<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 withnanobar.go(percentage)

arguments

  • percentage<Number> : percentage width of nanobar

Example

Create bar

varoptions={classname:'my-class',id:'my-id',target:document.getElementById('myDivId')};varnanobar=newNanobar(options);//move barnanobar.go(30);// size bar 30%nanobar.go(76);// size bar 76%// size bar 100% and and finishnanobar.go(100);

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:

.nanobar {width:100%;height:4px;z-index:9999;top:0}.bar {width:0;height:100%;transition: height.3s;background:#000;}

You should know what to do with that ;)




© 2016jacoborus - Released underMIT License

About

Very lightweight progress bars. No jQuery

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors10


[8]ページ先頭

©2009-2025 Movatter.jp