Package Exports
- @bornfight/b-scroll-to
- @bornfight/b-scroll-to/src/js/ScrollTo.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@bornfight/b-scroll-to) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
b-scroll-to [all b- libs]
Bornfight Studio frontend micro lib for smooth scrolling
📦 Getting Started
Dependency: gsap
- install
b-scroll-totrough npm or pull ti from git
npm i @bornfight/b-scroll-to- include b-scroll-to to your JS after running npm install
🔨️ Usage
JS
import ScrollTo from "@bornfight/b-scroll-to";
new ScrollTo();HTML markup
<a href="" data-scroll-to="#target" data-offset="100">
Scroll to target
</a>Basic usage tips
data-scroll-tocan be id or class of target elementdata-offsetis type number with value in pixels
💎 Customization
new ScrollTo({
ease: 'expo.out',
duration: 5
});✅ Properties
| Option | Type | Default | Example | Description |
|---|---|---|---|---|
| ease | string | "power3.inOut" | "expo.out" | Scroll ease can be modified (gsap eases) |
| duration | number | 1 | 10 | Duration of the scroll in seconds |
📦 Contribute
Gulp based system
- Gulp 4 used
- browsersync for live reload
npm run dev - dev environent with browsersyncLicense
MIT © Bornfight Studio