1.0.0 • Published 3 years ago

@mkoelewijn/anchor v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Anchor

Anchor is a simple plugin used to create smooth scrolling anchor links. It uses GreenSock to animate the window to the targetted area.

Installation

Want to use npm?

npm install @mkoelewijn/anchor

Want to use yarn?

yarn add @mkoelewijn/anchor

Usage

HTML

<a href="#anchor-link" data-anchor>This is an anchor link</a>

<div id="anchor-link"><p>Target area</p></div>

Javascript

import Anchor from '@mkoelewijn/anchor';

new Anchor();

Options

typeDefault
offsetInteger0