Simple JavaScript Image Parallax Animations Library – simpleParallax

Looking for a affordable website?

GET STARTED
www.codingexpertz.com
Simple JavaScript Image Parallax Animations Library – simpleParallax

File Size: 2775KB

Total Views: 1621

Date Created:

Last Modified Date:

Official Website: Go to website

License: MIT

SimpleParallax is very and simple lightweight JavaScript plugin for parallax image animations. It can convert any images to parallax animation within the website, there is no need to use any background images.

Features:

  • It can be installed with NPM and Yarn.
  • It works with <img> tag, so you don’t need to use it with background-img.
  • Easy to implement, no coding knowledge is required.
  • Supports to change orientation.
  • Can be delayed animation.

Install with NPM

$ npm install simple-parallax-js

Install with Yarn

$ yarn add simple-parallax-js

How to use it:

1. Include the Javascript simpleParallax.min.js at the bottom of the web page.

<script src="path/to/simpleParallax.min.js"></script>

2. or use the below CDN link provided by jsDelivr.com:

<script src="https://cdn.jsdelivr.net/npm/simple-parallax-js@5.2.0/dist/simpleParallax.min.js"></script>

3. Add the basic HTML to the page.

<img class="thumbnail" src="image.jpg" alt="image">

4. Initialize the plugin and we’re ready to go.

var image = document.getElementsByClassName('thumbnail');
new simpleParallax(image);

5. Initialize the plugin with several images:

var images = document.querySelectorAll('img');
new simpleParallax(images);

Plugin’s default options:

Setting Type Default Hint
orientation string up up – right – down – left – up left – up right – down left – down right
scale int 1.3 need to be above 1.0
overflow boolean false
delay int 0.4 the delay is in second
transition string false any CSS transition
customContainer string or node false this can be a string of directly a node

Join the Conversation

2 Comments

Leave a comment

Your email address will not be published. Required fields are marked *

STAYUPDATED

Receive all our future posts instantly in your inbox. Enter your email to enroll.