Streaming live at 10am (PST)

How to get Parallax background?


#1

So here is the code to a simple background parallax that i would like on my website.

$(window).scroll(function (e) {
parallax();
});

function parallax() {
var scrolled = $(window).scrollTop();
$('.pizza-hero').css('top', -(scrolled * 0.2) + 'px');
}

Where would i put this, in the header box of the custom code or the body box of the custom code? Here is the code pen of it working Here


Background layer that also moves up at different pace triggered by scroll (parallax)
#2

the body box custom code =)


#3