If you just want to scroll through elements at different speeds, some frameworks may be full. You can bind the function to the scroll event ( $ (document) .ready (function () {}); ) and manually set the top positions by multiplying the scroll value by a predetermined coefficient.
There are several guides on how to do this here and here .
From the first tutorial, this function is called when a scroll is detected and absolutely positioned elements are moved at different speeds, which gives a sense of depth and perspective:
function parallaxScroll(){ var scrolled = $(window).scrollTop(); $('#parallax-bg1').css('top',(0-(scrolled*.25))+'px'); $('#parallax-bg2').css('top',(0-(scrolled*.5))+'px'); $('#parallax-bg3').css('top',(0-(scrolled*.75))+'px'); }
It might be a simpler solution :)
alemangui
source share