Anchor
⚓️ Click and go to target. Pretty simple with only ~2KB and without dependencies.
Install
Bower
bower install anchor.js --save
npm
npm install js.anchor --save
CDN
Usage
The simplest way.
Contact Us! ...
var anchor = ; anchor;
Do you want more options? Sure!
View our Jobs! ...
Options
Our clients
Attributes
Attribute | Required? | Default | Description |
---|---|---|---|
data-anchor |
Yes | - | A CSS like selector to your target. |
data-anchor-duration |
No | 800 |
In milliseconds. |
data-anchor-offset |
No | 0 |
Self descriptive :) |
data-anchor-callback |
No | - | The callback will be called when the scroll is finished. |
data-anchor-easing |
No | easeInOutQuad |
The easing function. You can create your custom easing. Yes! |
Callback
Our clients
var anchor = ;anchor; { ;}
Easing
You can create your custom easing: Click here to create
Our clients
var anchor = easings: // Example with 'back in quartic' easing { var ts=t/=d*t; var tc=ts*t; return b+c*2*ts*ts + 2*tc + -3*ts; } ; anchor;
License
MIT.
Did you like it? Fork and contribute ;)
Made with ❤️