Skip to content

Latest commit

 

History

History
38 lines (24 loc) · 719 Bytes

README.md

File metadata and controls

38 lines (24 loc) · 719 Bytes

parallax

A zero-dependency, vanilla JavaScript library for creating parallax scrolling effects.

Installation

NPM:

npm install @jarijokinen/parallax --save

Yarn:

yarn add @jarijokinen/parallax

Usage

import { parallax } from '@jarijokinen/parallax';

document.addEventListener('DOMContentLoaded', () => {
  parallax();
});

Configuration

const options = {
  elements: document.querySelectorAll('.parallax'),
  speed: 0.3,
  throttleInterval: 30
};

parallax(options);

License

MIT License. Copyright (c) 2022 Jari Jokinen. See LICENSE for further details.