Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
jquery-data-parallax
Advanced tools
Create super fast parallax effects using data attributes.
bower install jquery-data-parallax
<script src="bower_components/jquery/dist/jquery.min.js"></script>
<script src="bower_components/jquery.requestAnimationFrame/jquery.requestAnimationFrame.min.js"></script>
<script src="bower_components/jquery-data-parallax/jquery.data-parallax.min.js"></script>
Either use data attributes:
<div data-parallax='{"y":"70%","scale":2,"rotate":180,"opacity":0}'></div>
or javascript:
$("#selector").parallax({
"y": "70%",
"scale": 2,
"rotate": 180,
"opacity": 0
});
All properties can be specified as number or string or object.
Using the object syntax you can explicitly pass in a from value (optional), as well as override global options:
<div data-parallax='{"opacity":{"to":1,"from":0.5,"duration":100},"translateY":"50%","duration":200}'></div>
Type: boolean or selector
Make an elements' position fixed during the scene.
Type string
Adds one or more classes to the element during the scene.
Type: number or string (percentage or viewport units)
translateX. Percentages in this case are relative to the duration.
Type: number or string (percentage or viewport units)
translateY. Percentages in this case are relative to the duration.
Type: number or string (percentage or viewport units)
translateZ. Percentages in this case are relative to the duration.
Type: number or string (percentage)
Type: number or string (percentage)
Rotation in degrees.
Type: string (e.g. "#ff0000")
Hex or rgb() color string.
Type: string (e.g. "#ff0000")
Hex or rgb() color string.
Type: number (0 - 1)
Type: number or string (percentage or viewport units)
Better use "y" where possible.
Type: number or string (percentage or viewport units)
Better use "x" where possible.
Type: number or string (percentage or viewport units)
Better use "scaleX" where possible.
Type: number or string (percentage or viewport units)
Better use "scaleY" where possible.
Type: number or string (percentage or viewport units)
Better use "x" where possible.
Type: number or string (percentage or viewport units)
Better use "y" where possible.
Options can be specified for all properties:
<div data-parallax='{"y":"70%","opacity":1,"duration":"150%"}'></div>
as well as (overridden) for each individually:
<div data-parallax='{"y":"70%","opacity":{"to":1,"duration":"85%"},"duration":"150%"}'></div>
All options are optional.
Type: number or string (percentage or viewport units) or callback function
Default: 0
If you need to start the scene on an absolute offset or after/before "triggerElement"'s offset.
Type: number or string (percentage or viewport units) or callback function
Default: as long as it's needed to scroll past the element
Percentages are calculated against element dimensions rather than viewport: "50%" == 0.5 * $(el).outerWidth(true).
For viewport relative values, use viewport units: vh or vw: "100vh" == $(window).height().
Setting duration to "0" will run it till the end of document.
Type: selector
Default: the element
Use this if you need another element to act as the trigger. It's not recommended to set this to "null" or "false", because working with absolute offsets can become difficult when you need to change things.
Type: number or string (percentage or viewport units) or callback function
Default: "100%" ("0%" for "pin" property)
0% is top of the viewport and 100% is bottom of the viewport.
Type: string or callback function
Default: "linear"
Type: string ("x" or "y")
Default: "y"
Type: boolean
Default: false
This is per element / selector option.
Type: boolean
Default: false
By default [data-parallax] is disabled on touch devices. To make it work add after including the js file:
$.parallax.enableTouchDevices = true;
This plugin was inspired from Parallax Done Right and Perfecting Parallax Scrolling
FAQs
Create super fast parallax effects using data attributes.
The npm package jquery-data-parallax receives a total of 2 weekly downloads. As such, jquery-data-parallax popularity was classified as not popular.
We found that jquery-data-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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.