Skip to content
This repository was archived by the owner on Nov 12, 2020. It is now read-only.

MathiasWP/ScrollProgressBar.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

18 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ScrollProgressBar.js

A super lightweight and robust library for displaying how far a user has scrolled on a webpage - only 4kb!

Core

Include the script in your HTML and create the ScrollProgressBar:

new ScrollProgressBar();

To activate the ScrollProgressBar, simply use the .start() function:

new ScrollProgressBar().start()

Options

The ScrollProgressBar can take in an object with options as a parameter. You can freely choose what options you want to use.

Name Type Default value Description
color String "#ffa453" Sets the color of the bar.
opacity String or Integer 1 Sets the opacity of the bar.
placement String "top" Sets the placement of the bar on the screen. Can either be "top", "left", "right" or "bottom"
size String '10px' Sets the size of the bar. Accepts any valid CSS-size property.
zIndex Integener 9999 Sets the z-index of the bar.

Examples

1:

new ScrollProgressBar({color: 'lightblue', size: '4rem', opacity: 0.5}).start()

2:

new ScrollProgressBar({color: '#ccc', size: '6px', placement: 'left', zIndex: 10}).start()

About

- A super lightweight and robust library for displaying how far a user has scrolled on a webpage. πŸ§žβ€β™‚οΈ

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors