
Research
/Security News
Contagious Interview Campaign Escalates With 67 Malicious npm Packages and New Malware Loader
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.
universal-parallax
Advanced tools
Easy parallax plugin using vanilla javascript. Works on mobile devices (really). Lightweight (2kb). Cross browser compatibility
Easy parallax plugin using pure javascript. Lightweight (2kb) and cross browser compatibility - including mobile platforms (iOS, Android).
$ npm i universal-parallax -S
Choose between:
<head>
section<link href="node_modules/universal-parallax/dist/universal-parallax.min.css" rel="stylesheet">
.parallax__container {
clip: rect(0, auto, auto, 0);
height: 100%;
left: 0;
overflow: hidden;
position: absolute;
top: 0;
width: 100%;
z-index: -100;
}
.parallax {
position: fixed;
top: 0;
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
-webkit-transform-style: preserve-3d;
transform-style: preserve-3d;
width: 100%;
/* BG behaviour */
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
:zap: BG behaviour in seperate class gives more flexibility controlling them :zap: SASS version available in /dist folder
If <section>
is your container, make the parallax element inside it
<section>
<div class="parallax" data-parallax-image="path/to/your_image">
</section>
:zap: You can also use background-image
to define your image instead of using data-parallax-image=""
Include the script to your project
<script src="node_modules/universal-parallax/dist/universal-parallax.min.js"></script>
Initialize the JS function
<script>
new universalParallax().init();
</script>
That's it! :checkered_flag:
You can change the parallax speed; the higher the number, the slower the parallax effect
new universalParallax().init({
speed: 6.0
});
:zap: speed: 1
is the minimum value before the background image is fixed
If you want your backround color to shine through or dampen the image without making it a .png - just add transparency to it
.parallax {
opacity: 0.5;
}
FAQs
Easy parallax plugin using vanilla javascript. Works on mobile devices (really). Lightweight (2kb). Cross browser compatibility
We found that universal-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
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.