Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jQuery(function( $ ){
- // Enable parallax and fade effects on homepage sections
- $(window).scroll(function(){
- scrolltop = $(window).scrollTop()
- scrollwindow = scrolltop + $(window).height();
- //$(".home-top-wrap").css("backgroundPosition", "0px " + -(scrolltop/6) + "px");
- if( scrollwindow > $(".home-top-wrap").offset().top ) {
- // Enable parallax effect
- backgroundscroll = scrollwindow - $(".home-top-wrap").offset().top;
- $(".home-top-wrap").css("backgroundPosition", "0px " + -(backgroundscroll/6) + "px");
- }
- if( scrollwindow > $(".home-last-wrap").offset().top ) {
- // Enable parallax effect
- backgroundscroll = scrollwindow - $(".home-last-wrap").offset().top;
- $(".home-last-wrap").css("backgroundPosition", "0px " + -(backgroundscroll/6) + "px");
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement