Jump to content

Scrolling text over a fixed background within a section

Recommended Posts

Site URL: https://www.purehomeoffice.com/aspire-1

Heya

I'd like to create a section with a fixed height of the window / media screen that scrolls through all the available text / content before proceeding to the next section.

I found this bit of code that I believe will do what I want, but I don't know exactly how to implement it.

https://codepen.io/aakhya/pen/QJWovp

I attached a video to show what I'd like to achieve.

 

Using 7.1, btw.

Link to comment

You could set the background of the div manually to the URL of the image, and then hide the image tag. That's what they did in the link you posted.  You would need to manually do it for each section.

[data-section-id="5f0756efed03a802582b95aa"] .section-background img {
  display:none;
}

[data-section-id="5f0756efed03a802582b95aa"] .section-background {
  background: url('https://images.squarespace-cdn.com/content/v1/5ee0ee00a0a12e14f700c502/1594316294831-H3VJXJTZAZNJI3G2QK5N/ke17ZwdGBToddI8pDm48kBQ_OmUn0XNjqwyBYOIFwXV7gQa3H78H3Y0txjaiv_0fDoOvxcdMmMKkDsyUqMSsMWxHk725yiiHCCLfrh8O1z4YTzHvnKhyp6Da-NYroOW3ZGjoBKy3azqku80C789l0p5uBJOnOmCWBN4JfYsIDyRB3ELHLLET9s1anQygWAMDSh6zbPa8Vo37A4r2-aOSIQ/IMG_1660.jpeg?format=2500w');
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center center;
}

 

Edited by rwp
Link to comment
  • 2 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.