Parallax
Two ways to give a photo depth. A moving image drifts slowly as you scroll (data-parallax). A fixed background stays still while the page scrolls over it (.bg-fixed).
Moving image
Put data-parallax on an image. The number is the speed: higher moves more. Wrap it in a box with .parallax-box (it hides the overflow) and the image is made taller than the box so no gap shows. Use it on its own element, not together with data-animate. It needs animations.js (GSAP and ScrollTrigger).
Image only
With text on top
Let us talk about your property needs
The photo drifts slowly behind the text as you scroll.
Talk to an agent<div class="parallax-box"><img src="..." alt="" data-parallax="0.3"></div> Speed 0.3 is a good start. Above 0.3 the image may need to be taller than the default 190%.
Fixed background
The photo stays in place while the page scrolls over it, like a window. It is pure CSS, so it needs no JavaScript. Set the picture with background-image in the style attribute. On phones and for visitors who prefer reduced motion it becomes a normal background, because many phones ignore a fixed background.
With a dark layer and text
Let us find your next home
Scroll the page: the photo stays put while this band moves over it.
Talk to an agentPhoto only
<section class="bg-fixed" style="background-image: url(photo.webp)"><div class="bg-fixed-inner">...</div></section> Add bg-fixed--clear for a picture strip with no layer or text, and bg-fixed--tall for a taller band.
Classes and attributes
| Name | Purpose |
|---|---|
data-parallax | On an image. Speed factor, for example 0.3. Higher moves more. |
.parallax-box | Box that hides the overflow and makes the image taller than itself. |
.bg-fixed | Band with a fixed background photo and a dark layer. Photo set with style="background-image: url(...)". |
.bg-fixed-inner | Centered text block inside the band. |
.bg-fixed--clear | Photo only, no layer. |
.bg-fixed--tall | Taller band. |
Moving image only moves with transform, so it stays smooth. It is skipped for visitors who prefer reduced motion. For scroll reveals and counters see Animations.