# javascript-en

See all tags

Code snippet: The easiest way for a parallax background with CSS and JavaScript

Here is the JavaScript part: window.addEventListener("scroll", event => { document.body.style.backgroundPosition = "0px -" + (window.pageYOffset / 2) + "px";...

Read full article