
Security News
Django Joins curl in Pushing Back on AI Slop Security Reports
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
parallax-scrolling
Advanced tools
A lightweight JavaScript library for adding a smooth parallax scrolling effect to elements.
Install via npm
:
npm install parallax-scrolling
import ParallaxLayer from "parallax-scrolling";
// or
const ParallaxLayer = require("parallax-scrolling");
const parallax = new ParallaxLayer();
const element = document.getElementById("parallax-item");
parallax.createLayer(element, { type: "translate", layer: 2, direction: "top" });
parallax.start();
new Parallax(options)
Option | Type | Default | Description |
---|---|---|---|
translate | number | 0.5 | Adjusts the parallax translation speed |
scale | number | 0.005 | Adjusts the scaling effect |
parallax.createLayer(dom, options = { type, layer, direction, unit })
Registers an element for the parallax effect.
Parameter | Type | Default | Description |
---|---|---|---|
dom | HTMLElement | Required | The element to apply the effect on |
type | "translate", "scale" | Required | The effect type |
layer | number | Required | The depth of the layer (higher values = slower movement) |
direction | "Top", "Left", "Right", "Bottom" | - | The direction of movement |
unit | string | "px" | The CSS unit (px, %, em, etc.) |
parallax.start()
Starts the parallax effect (listens for scroll events).
parallax.stop()
Stops the parallax effect.
Works in all modern browsers (Chrome, Firefox, Edge, Safari).
This project is licensed under the MIT License by default.
Contributions are welcome! If you'd like to improve this project:
FAQs
A simple JS library for parallax scrolling effect
The npm package parallax-scrolling receives a total of 0 weekly downloads. As such, parallax-scrolling popularity was classified as not popular.
We found that parallax-scrolling demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.