Change Section Background on Scroll

Description

#1. Install Code

If you use Personal/Basic Plan and your plan doesn’t support Injection, see #2.2.

You can also use this plugin to do effect.

#1.1. First, hover on top right of all sections where you want to change Background Color on Scroll > Click Edit Section

04.26c13v3 Change Section Background on Scroll

Enter word: one, second, third, fourth, fifth, sixth, seventh…to all sections. Something like this.

04.26c13v3 Change Section Background on Scroll

04.26c13v3 Change Section Background on Scroll

04.26c13v3 Change Section Background on Scroll

#1.2. Hover on Page where you added these sections > Click Gear icon

04.26c13v3 Change Section Background on Scroll

Click Advanced > Paste this code.

<!-- @tuanphan 04.26c13v2 Section Color on Scroll -->
<script>
window.SectionBgConfig = {
  transition: "0.6s ease",
  sections: [
    { selector: '#one', color: "white" },
    { selector: '#second', color: "red" },
    { selector: '#third', color: "rgba(255,0,0,0.5)" },
    { selector: '#fourth', color: "blue" },
    { selector: '#fifth', color: "yellow" },
    { selector: '#sixth', color: "yellow" },
    { selector: '#seventh', color: "orange" }
  ]
};
</script>
<script src="https://code.beaverhero.com/other/0426c13v2sectioncoloronscroll.js"></script>

04.26c13v3 Change Section Background on Scroll

#2. Customize

If you need to customize more, you can message me or useĀ this AI tool, it was designed for the Squarespace site.

#2.1. You can change section color – anchor id here

window.SectionBgConfig = {
  transition: "0.6s ease",
  sections: [
    { selector: '#one', color: "white" },
    { selector: '#second', color: "red" },
    { selector: '#third', color: "rgba(255,0,0,0.5)" },
    { selector: '#fourth', color: "blue" },
    { selector: '#fifth', color: "yellow" },
    { selector: '#sixth', color: "yellow" },
    { selector: '#seventh', color: "orange" }
  ]
};

#2.2. If you use Personal/Basic Plan and your plan doesn’t support Injection, you can add a Markdown Block in Current Page.

04.26c03v1 Gallery Grid Sync Blog Turn to Carousel

Then use this code.

<script>
window.SectionBgConfig = {
  transition: "0.6s ease",
  sections: [
    { selector: '#one', color: "white" },
    { selector: '#second', color: "red" },
    { selector: '#third', color: "rgba(255,0,0,0.5)" },
    { selector: '#fourth', color: "blue" },
    { selector: '#fifth', color: "yellow" },
    { selector: '#sixth', color: "yellow" },
    { selector: '#seventh', color: "orange" }
  ]
};
</script>
<script src="https://code.beaverhero.com/other/0426c13v2sectioncoloronscroll.js"></script>

04.26c13v3 Change Section Background on Scroll

Buy me a coffee