@lahautesociete/parallax

0.1.4 • Public • Published

LHS Parallax

LHS Parallax plugin to make parallax animation when scrolling.

Installation

npm install @la-haute-societe/lhs-parallax

Usage

HTML

Create an HTML element with the scroll-level attribute.

You can pass two attributes to your element :

  • scroll-level - Parallax level (required)
  • scroll-direction - Parallax direction (optional) : x / y (default y),
<div class="myElement" scroll-level="3" scroll-direction="x"></div>

JavaScript

Import LhsParallax where you want to use it.
Then get the HTML element and create an instance of LhsParallax passing your element in parameter.

import LhsParallax from '@la-haute-societe/lhs-parallax';
var myElement = document.querySelector('.myElement');
var scroll = new LhsParallax(myElement);

Package Sidebar

Install

npm i @lahautesociete/parallax

Weekly Downloads

0

Version

0.1.4

License

MIT

Last publish

Collaborators

  • lahautesociete