Last active
August 29, 2015 14:00
-
-
Save jillmugge/11182168 to your computer and use it in GitHub Desktop.
Add Div to Builder (outside of Container) for parallax scroll
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function parallax(){ | |
var scrolled = jQuery(window).scrollTop(); | |
jQuery('.custom-bg').css('left', -(scrolled * 0.2) + 'px'); | |
jQuery('.custom-bg').css('top', -(scrolled *0.3) + 'px'); | |
} | |
jQuery(window).scroll(function(e){ | |
parallax(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment