anchor-offset

1.0.6 • Public • Published

anchor-offset

Offset scroll position for page anchors.

npm version Travis build status Coverage Status Dependency Status devDependency Status

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> 

Package Sidebar

Install

npm i anchor-offset

Weekly Downloads

0

Version

1.0.6

License

ISC

Last publish

Collaborators

  • ericvaladas