1.0.6 • Published 6 years ago
anchor-offset v1.0.6
anchor-offset
Offset scroll position for page anchors.
Useful for websites that have fixed content at the top of the page, such as a navigation bar.
Usage
anchorOffset(offset)
Argument | Default | Description |
---|---|---|
offset | 0 | The amount to offset in pixels. |
Node
Install the package with npm.
npm install --save anchor-offset
Import the anchor-offset module.
import anchorOffset from 'anchor-offset';
anchorOffset(50);
Web
Get the latest release and include it in your page.
<script src="anchor-offset.js"></script>
<script>
anchorOffset(50);
</script>