
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
motion-parallax
Advanced tools
You can use npm:
npm install motion-parallax --save
and then in you js file:
const Parallax = require('motion-parallax');
Or download parallax.min.js
file and include in you document:
<script src="/path/to/parallax.min.js"></script>
<div class="parallax">
<div class="box"></div>
<div class="box"></div>
</div>
const parallax = new Parallax('.box'); // className or other selector
parallax.start();
new Parallax('className_or_other_selector', [config]);
Options can via data attributes setting:
<div class="parallax">
<div class="box" data-xrange="20" data-yrange="10"></div>
<div class="box" data-xrange="10" data-yrange="20"></div>
</div>
all config:
{
xRange: 20, // Use attribute on priority
yRange: 20,
listenElement: window,
enterCallback: function() {},
leaveCallback: function() {}
}
// The above values are all defaults
include add
,remove
,refresh
.
Add a new animation element.
parallax.add(element, [config])
const parallax = new Parallax('.box');
parallax.add('.other');
parallax.add('.three');
parallax.refresh();
This api can remove alreay animate element, but you need manual call refresh
api make the operation effective.
const parallax = new Parallax('.box');
parallax.add('.other');
parallax.add('.three');
parallax.refresh();
// then you don't need className other, you can
parallax.remove('other').refresh();
const parallax = new Parallax('.box');
parallax.add('.other');
parallax.add('.three');
parallax.refresh();
// then you don't need className other and three, you can
parallax.remove('other');
parallax.remove('other');
parallax.refresh();
const parallax = new Parallax('.box');
parallax
.add('.other')
.add('.three')
.refresh();
FAQs
Focus on interaction, rather than just rolling parallax
The npm package motion-parallax receives a total of 2 weekly downloads. As such, motion-parallax popularity was classified as not popular.
We found that motion-parallax demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.