![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
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
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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.