Simple JavaScript plugin that indicates scroll progress.
Include scrollprogress.min.js
inside <body>
tag.
<!-- javascript -->
<script src="scrollprogress.min.js"></script>
Initialize the plugin by running scrollprogress();
.
First argument is the selector and is mandatory, while the second argument (options) can be omitted and will fall back on defaults.
<script>
scrollprogress('body');
</script>
Pass a "options" object as a second argument to override the plugin defaults.
scrollprogress('body', {
// Options
});
Property | Type | Default | Description |
---|---|---|---|
height | string | "4px" | Defines the height of the horizontal progress bar on top of the screen. |
backgroundColor | string | "#6deabb" | Progress bar background color. |
glow | bool | true | Adds a glow around the progress bar using css property "box-shadow". |
glowLevel | string | "4px | Define the size of the glow |
transparency | bool | false | Enable/disable progress bar transparency |
transparencyLevel | number | 0.75 | Define transparency level ( from 0 to 1 ). |