Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jQuery(window).on('scroll', parallaxScroll);
- function parallaxScroll(){
- var scrolled = $(window).scrollTop();
- jQuery('#parallax-lvl-0').css('top',(0-(scrolled*.25)));
- jQuery('#parallax-lvl-1').css('top',(0-(scrolled*.5)));
- jQuery('#parallax-lvl-2').css('top',(0-(scrolled*.75)));
- jQuery('#parallax-lvl-3').css('top',(0-(scrolled*.9)));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement