Advertisement
Guest User

Untitled

a guest
Nov 5th, 2015
129
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. jQuery(window).on('scroll', parallaxScroll);
  2.  
  3. function parallaxScroll(){
  4.  
  5. var scrolled = $(window).scrollTop();
  6.  
  7. jQuery('#parallax-lvl-0').css('top',(0-(scrolled*.25)));
  8. jQuery('#parallax-lvl-1').css('top',(0-(scrolled*.5)));
  9. jQuery('#parallax-lvl-2').css('top',(0-(scrolled*.75)));
  10. jQuery('#parallax-lvl-3').css('top',(0-(scrolled*.9)));
  11. }
Advertisement
RAW Paste Data Copied
Advertisement