I found an easy code to create a parallax effect with jquery:
function parallax(intensity, element) {
$(window).scroll(function() {
var scrollTop = $(window).scrollTop();
var objPos = scrollTop / intensity + 'px';
element.css('transform', 'translateY(' + objPos + ')');
});
}
I completly understand how this code works, but how do I apply this on different elements?
So for example #div1 with intensity 3, #div2 with intensity 5.
Thank you for you help in advance! :)