Minimal Image Parallax Scroll Effect In JavaScript – Parallax.js

Category: Animation , Javascript | June 1, 2020
Authorhimanshu12345yadav
Last UpdateJune 1, 2020
LicenseMIT
Views1,023 views
Minimal Image Parallax Scroll Effect In JavaScript – Parallax.js

Just another vanilla JavaScript implementation of the smooth parallax scroll effect for images.

Works with any images regardless of image size. If the image height is less than the container height the library will automatically scale the image to overflow the container.

How to use it:

1. Add the stylesheet parallax.css he JavaScript parallax.js to the web page.

<link rel="stylesheet" href="parallax.css" />
<script defer src="parallax.js"></script>

2. Add your image to the parallax container and the library will take care of the rest.

<div class="parallax-container">
  <img src="bg.jpg" alt="">
</div>

You Might Be Interested In:


Leave a Reply