1.0.7 • Published 11 months ago

@bornfight/b-scroll-next v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

b-scroll-next [all b- libs]

Bornfight frontend micro lib for scrolling to next section

GitHub package.json version GitHub package.json dynamic GitHub issues GitHub

📦 Getting Started

Dependency: gsap

  • install b-scroll-next trough npm or pull ti from git
npm i @bornfight/b-scroll-next
  • include b-scroll-next to your JS after running npm install

🔨️ Usage

JS
import ScrollNext from "@bornfight/b-scroll-next";

new ScrollNext();
HTML markup
<p class="js-scroll-next">
    Go next
</p>
Basic usage tips
  • all elements with .js-scroll-next class will trigger scroll

💎 Customization

import ScrollNext from "@bornfight/b-scroll-next";

new ScrollNext({
    element: ".js-links",
    ease: "expo.inOut",
    duration: 5,
    offset: 200
});

✅ Properties

OptionTypeDefaultExampleDescription
elementstring".js-scroll-next"".js-my-scroll-element"Elements that will be used as "scroll next" triggers
offsetnumber0200number type value - scroll will be offset by that amount in pixels
easestring"power3.inOut""expo.out"Scroll ease can be modified (gsap eases)
durationnumber0.510Duration of the scroll in seconds

🚀 Useful to know

  1. offset will reflect to every element inside that instance
  2. without any option it will scroll just below clicked element

📦 Contribute

Gulp based system

npm run dev - dev environent with browsersync

License

MIT © Bornfight

1.0.7

11 months ago

1.0.6

11 months ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago