Simplest Background Parallax Scroll Library – parascroll.js

Category: Animation , Javascript | August 18, 2017
Views Total:2,671 views
Official Page:Go to website
Last Update:August 18, 2017


Simplest Background Parallax Scroll Library – parascroll.js


parascroll.js is a dead simple and ultra-light (~1kb) JavaScript library that applies a subtle parallax scrolling effect on the background image of a container you specify. No CSS and framework required.

Basic usage:

Load the compiled and minified version of the parascroll.js in the document.

<script src="parascroll.js"></script>

Add the ‘parallax-bg’ CSS class to the target container and specify the background image in the ‘data-bgurl’ attribute.

<div class="parallax-bg header" data-bgurl="1.jpg">Header</div>

That’s it. You are able to change the default animation speed by overriding the ‘SCROLL_SPEED’ parameter as this:

var SCROLL_SPEED = 0.6;

You Might Be Interested In:

Leave a Reply