Multi Layer Parallax Scroll - Download Multi-layer Image Parallax Scrolling Effect With jQuery

Download Multi-layer Image Parallax Scrolling Effect With jQuery

Posted on

This time I will share jQuery Plugin and tutorial about Multi-layer Image Parallax Scrolling Effect With jQuery, hope it will help you in programming stack.

Multi Layer Parallax Scroll - Download Multi-layer Image Parallax Scrolling Effect With jQuery
File Size: 38.8 KB
Views Total: 4246
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

A dead simple jQuery solution that applies a subtle parallax scrolling effect to multi-layered images using CSS3 2D transforms.

How to use it:

1. Add parallax images to the webpage.

1 <img src="layer0.png" id="layer0" alt="">
2 <img src="layer1.png" id="layer1" alt="">
3 <img src="layer2.png" id="layer2" alt="">
4 <img src="layer3.png" id="layer3" alt="">
5 <img src="layer4.png" id="layer4" alt="">
6 ...

2. Load the latest version of jQuery JavaScript library in the webpage.

2         integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
3         crossorigin="anonymous">
4 </script>

3. Activate the parallax scrolling effect on the images using CSS3 transform > translate property.

01 $(window).scroll(function(){
02  
03   var ws = $(window).scrollTop();
04  
05   $('#layer4').css({
06     'transform': translate(0px, -${ws / 1.2}px)
07   });
08  
09   $('#layer3').css({
10     'transform': translate(0px, -${ws / 2}px)
11   });
12  
13   $('#layer2').css({
14     'transform': translate(0px, -${ws / 3}px)
15   });
16  
17   $('#layer1').css({
18     'transform': translate(0px, -${ws / 4}px)
19   });
20  
21 });

This awesome jQuery plugin is developed by rijinmk. For more Advanced Usages, please check the demo page or visit the official website.

source : jquery.net