Skip to content

How to Change Background Color On Scroll in WordPress?

Key Takeaways

  • Nexter Blocks Container block uses On Scroll Animation under Style > Background Deep Layer to change a section’s background color as visitors scroll past it.
  • Item List supports as many color stops as needed, with 3 items by default, and each item can use a solid color or a gradient background.
  • Gradient Like Effect blends colors gradually and uses Transition Duration (s), while Direct Color Change Effect switches instantly at each scroll point.
  • At least two Item List entries with different colors are required for a visible change, and a single item shows no transition.
Table of Contents

What It Does

The Container block’s On Scroll Animation option changes a section’s background color as visitors scroll past it. Instead of one static background, the container cycles through a list of colors you define, blending or switching between them as the page scrolls.

To check the complete feature overview documentation of the Nexter Blocks Container block, click here.

Requirement – This block is a part of Nexter Blocks. Make sure it’s installed and activated to use this feature.

Why It Matters

A page where every section looks identical can feel flat, especially on long scrolling layouts. Tying the background color to scroll position gives each section its own visual identity without adding custom CSS or JavaScript, and it draws the eye to the exact moment a new section begins.

What You Get

  • An On Scroll Animation option under Style > Background Deep Layer
  • An Item List repeater to define as many color stops as you need (3 by default)
  • A choice between Gradient Like Effect (colors blend gradually) and Direct Color Change Effect (colors switch instantly)
  • A Transition Duration (s) control for the gradient blend speed

Benefits

  • Landing pages for SaaS or product launches that use scroll-triggered color transitions to highlight different feature sections
  • Portfolio or agency websites where color changes on scroll reinforce visual hierarchy and guide the reader down the page
  • WooCommerce product pages that use a sticky container with a changing background to emphasize CTAs during scroll

Capabilities

Add or remove Item List entries freely, each with its own solid color or gradient background. Pick Gradient Like Effect when you want a smooth, continuous blend across all colors as the visitor scrolls, or Direct Color Change Effect for a crisp switch at each scroll point. Transition Duration only applies to the Gradient Like Effect.

How It Works

Each Item List entry acts as one color stop mapped to a position in the container’s scroll range. As the visitor scrolls through the container, Nexter Blocks reads the scroll position and either interpolates between stops (Gradient Like Effect) or jumps to the next stop once it’s reached (Direct Color Change Effect). At least two items with different colors are needed for a visible change.

How to Use It

Add the Container block with the appropriate layout to the page and follow the steps below.

1. Go to Style > Background Deep Layer, then select On Scroll Animation from the Select Background Option dropdown.

Background Deep Layer On Scroll Animation panel in the Container block
Container > Style > Background Deep Layer with On Scroll Animation selected, showing the Item List and Transition Duration controls
Selecting On Scroll Animation from the Background Deep Layer panel

2. In the Item List section, you’ll find three items by default. Open an item and, in its Background section, add either a solid color or a gradient.

3. Set a different background color on at least one more item to see the color-change effect on scroll. Use the + Add Item button to add more color stops.

4. From the On Scroll Change dropdown, choose how the colors change:

  • Gradient Like Effect – the colors added to the repeater items change gradually with a transition, creating a gradient color effect as you scroll.
  • Direct Color Change Effect – the colors added to the repeater items change instantly as you scroll.

Note: For the Gradient Like Effect, you can set the animation duration for changing background colors from the Transition Duration (s) section.

The background color now changes as visitors scroll through the container.

Background color changing as the container is scrolled into view

Use Cases

  • Landing pages for SaaS or product launches that use scroll-triggered color transitions to highlight different feature sections
  • Portfolio or agency websites where color changes on scroll reinforce visual hierarchy and guide the reader down the page
  • WooCommerce product pages that use a sticky container with a changing background to emphasize CTAs during scroll

Limitations

  • You need at least two Item List entries with different colors for a visible change – a single item shows no transition.
  • This option changes solid colors and gradients only. For rotating images instead, use the Creative Gallery option under the same Background Deep Layer panel.
  • Transition Duration only affects the Gradient Like Effect; Direct Color Change Effect switches instantly regardless of this setting.

Troubleshooting

  • No color change is visible – check that at least two Item List entries have different background colors set; a list with one item (or identical colors) shows no transition.
  • Colors jump instead of blending – the On Scroll Change dropdown is set to Direct Color Change Effect; switch it to Gradient Like Effect for a smooth blend.
  • Transition Duration doesn’t seem to do anything – this control only applies to the Gradient Like Effect, as noted on the panel; it has no effect when Direct Color Change Effect is selected.

Share your Thoughts

Still in Doubt? Let’s Assist You

Have Feedback or Questions?

Join our WordPress Community on Facebook!

Related Frequently Asked Questions

Why isn’t the background color changing on scroll in WordPress?

The effect only appears when the Container block has at least two Item List entries with different background colors. Nexter Blocks reads each item as a color stop, so a single item or identical colors will look static. The page also notes that this feature lives under Style > Background Deep Layer, and it only works when the Container block from Nexter Blocks is installed and activated.

Should I use Gradient Like Effect or Direct Color Change Effect for scroll backgrounds?

Gradient Like Effect is the better choice when you want the background to blend smoothly as the visitor scrolls, because Transition Duration only applies there. Direct Color Change Effect is better when you want a hard switch at each scroll point with no blending. In practice, smooth blends work well for long sections, while direct changes are easier to read when each section needs a clear visual break.

What kind of pages work best with scroll-triggered background color changes?

The page calls out landing pages for SaaS or product launches, portfolio or agency websites, and WooCommerce product pages. The common thread is that the color shift helps guide attention as people move down the page. It works especially well when you want each section to feel distinct without adding custom CSS or JavaScript.

Can I use images instead of colors for scroll background changes?

This feature changes solid colors and gradients only. For rotating images, the page points to the Creative Gallery option under the same Background Deep Layer panel. That matters because the scroll animation here is built around color stops, so image-based effects need a different background option.

What should I do if the colors change too abruptly on scroll?

That usually means On Scroll Change is set to Direct Color Change Effect. Switch it to Gradient Like Effect if you want a smoother blend between stops. The Transition Duration control only affects Gradient Like Effect, so if direct switching is selected, changing duration will not soften the transition.

What do I need before using scroll background animation in Nexter Blocks?

The Container block has to be part of Nexter Blocks and activated first, because this feature sits inside that block’s Background Deep Layer settings. From there, you add the Container block to the page and define your color stops in Item List. The key setup detail is having at least two different colors so the scroll position has something visible to transition between.

Last reviewed: August 31, 2026

Related Docs