Navease.js
Intro
Javascript library enabling smooth scroll between anchor links on the page
using different easing functions.
Navease uses Easing.js for easing.
Features:
- Scrolling speed can be customized
- Different easing functions (please refer to Easing.js for the full list)
- Navease functionality can be set to elements with specified css selector only
Source code is available at Github
Licensed under the MIT License, © 2016 Mark Rolich
JSDoc
new Navease(frames, easing, selector)
Parameters:
Name | Type | Argument | Default | Description |
---|---|---|---|---|
frames | number | <optional> | 30 | frames count (lower is faster, minimum is 1) |
easing | string | <optional> | "easeInOutQuad" | easing function name from Easing.js |
selector | string | <optional> | "a[name]" | apply Navease functionality to the specified selector only |
- Throws an exception if easing function is not defined in Easing.js
- Throws an exception if frames count is less than 1
Examples
Using default values:
new Navease();
Navease will be applied to all anchor links (a[name])
with "easeInOutQuad" easing, and will contain 30 frames (duration will be 0.5 seconds at 60 fps)
new Navease(60, "easeInOutCubic", ".scroll");
Navease will be applied to elements with css class "scroll",
with "easeInOutCubic" easing, and will contain 60 frames (at typical 60 frames per second the duration will be 1 second)
Navigation on the current page uses Navease.js with default settings (you can minimize the page for better experience)
Browser Compatibility
- IE >= 10
- Chrome
- Firefox
- Safari