Jump to content

Sticky background with scroll text

Go to solution Solved by Ziggy,

Recommended Posts

Hi there,

I'm not sure if I can do this on Squarespace with custom CSS, but is there a way to keep the background image, header, and divider (left column) sticky while making the right column (organization timeline) scroll? 

Screen Shot 2024-06-17 at 8.58.16 PM.png

Screen Shot 2024-06-17 at 8.58.36 PM.png

Link to comment

Yes, this is generally possible, can you share your website URL and this page?

Please like and upvote if my comments were helpful to you. Cheers!

Zygmunt Spray
Squarespace Website Designer
Contact me: 
https://squarefortytwo.com 
Hire me on Upwork!

🔌 Ghost Squarespace Plugins (Referral link)
📈 SEO Space (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲 SQSP Themes (Referral link) 
Spark Plugin (Referral link) 

 Did I help? Buy me a coffee?

Link to comment
  • Solution

A few steps; first combine this text into a single text block:

image.thumb.png.342d9c156ad2c8b642522eac2a616e0b.png

Pin this block with this button, and set the offset to 60px:

image.png.f2ce24c1d5b74facc6dc4327e4c2c07c.png

Remove the background image from the section and add this code:

section[data-section-id="66401df29cb8660c4f9af59c"] {
  .section-background{
    &::after {
    /*creating the element*/      
      content: "";
      width:100%;
      height:100%;
      position: absolute;
      
      /*adding the image*/  
      background-image:url('https://images.squarespace-cdn.com/content/v1/564557c3e4b0c87513050114/1601421132965-VGA8O3U4MAXR0TRBFDJU/Guests+%40+Gallery+Back+Room.jpg');
      background-repeat:no-repeat;
      
      /*positioning the image*/  
      background-size:cover;
      background-position:center center;
      background-attachment: fixed;
      
      /*mobile*/  
      @media(max-width:787px){
        background-position:center center;
        background-attachment: scroll !important;
      }
    } 
  }
}

This code was developed by Will Myers, you can see his website and instructions that go along with it here: 
https://www.will-myers.com/adding-parallax-effect-to-a-background-image-in-squarespace-71

Please like and upvote if my comments were helpful to you. Cheers!

Zygmunt Spray
Squarespace Website Designer
Contact me: 
https://squarefortytwo.com 
Hire me on Upwork!

🔌 Ghost Squarespace Plugins (Referral link)
📈 SEO Space (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲 SQSP Themes (Referral link) 
Spark Plugin (Referral link) 

 Did I help? Buy me a coffee?

Link to comment

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.