A JavaScript library to add parallax effects to the background-image

Download GitHub


There are prenty of libraries out there to add parallax effects
But still, We had reasons we had to make this library.

1. Simplicity

We just want to add parallax effects to background-image and We don't need to add effects to any other elements too

2. Speed Control

Almost all libraries that we encountered, need speed option
but What if the images are too small that images can't move anymore? In some cases, it's difficult to set the speed of parallax effects.
That's why, We want the library to set the speed by itself, So that the whole image will be shown during scroll


Quick start


Using CDN

You can easily start by using CDN.

Add the following description in the <head> tag of the web page you want to use Backpax.

<script src="">

You can also bundle the library with Browserify/Webpack

npm install backpax --save
import Backpax from 'backpax'

Just replace the style="background-image:url(...)" to data-img="..."

<div class="js-parallax"
  <p>contents here</p>

Write the following script

new Backpax('.js-parallax');




You can also set some breakpoints so that you can optimize image size in accordance with the screen size.

Add the following description to the target tag.

<div class="js-parallax"
  <p>contents here</p>

And write the following script

new Backpax('.js-parallax');

You can also use NodeList instead of string

new Backpax(document.querySelectorAll('.js-parallax'));

Join development on