1.1.0 • Published 4 years ago

pageprogress v1.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

Installation

npm install pageprogress

Usage

import PageProgress from 'pageprogress';

const progress = new PageProgress({
  position: 'left',
  width: 8,
  color: '#000000'
});

progress.init();

If you want to remove the native scroll bar, add these lines to your main CSS file :

/* Chrome, Safari, Opera */
::-webkit-scrollbar {
  display: none;
}

/* Firefox */
* {
  scrollbar-width: none !important;
}

/* IE, Edge */
body {
  -ms-overflow-style: none;
}

Options

OptionTypeDefaultDescription
containerobjectdocument.bodyContainer used to calculate page height
positionstringrighttop, right, bottom, left
widthnumber8
colorstring#000000

Instance methods

init()

Add progress indicator to the DOM, listen to scroll event.

destroy()

Remove listener and progress indicator from the DOM.

Browser support

Works on most modern browsers. Chrome, Firefox, Safari, Edge... To get IE support, you may need polyfills.

License

MIT, see LICENSE.md for details.

1.1.0

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.2

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago