JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
demo
dist
src
.babelrc
.gitignore
LICENSE
README.md
package.json
webpack.config.js
yarn.lock

README.md

GitHub stars GitHub forks GitHub release GitHub issues GitHub last commit Github file size npm npm license Analytics Open Source Love svg1 Maintenance

ForTheBadge built-with-love

IntroScroll

Create a fullscreen intro section and dismiss it in a single gesture.

Description

This library creates a fullscreen intro section and disables the default page scroll.

The page scroll is being enabled again after a single mouse scroll, touch swipe up or any gesture that forces the page to move upwards.

Install

npm i introscroll

or

yarn add introscroll

or

Just download this repository and link the files located in dist folder.

Then

import IntroScroll from 'introscroll';

and initialize an instance using default settings

const intro = new IntroScroll();

or add your own settings

const intro = new IntroScroll({
  element: '#your-fullscreen-section',
  wrapper: '#your-fullscreen-sections-wrapper',
  container: '#your-fullscreen-sections-container',
  trigger: '#your-fullscreen-sections-link',
  scrollClass: 'intro--scrolled',
  duration: 1000,
  afterScroll(instance) {
    console.log(instance.element);
  }
});

For more details please see the demo.

LICENSE

MIT