Jump to content

Recommended Posts

Sure, You can do that. Here is the updated code. Replace the data-section-id with yours. 

[data-section-id="123"]{
  .section-background{
    &::after {
    /*creating the element*/      
      content: "";
      width:100%;
      height:100%;
      position: absolute;
      
      /*adding the image*/  
      background-image:url(image.jpeg);
      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: fixed !important;
      }
    } 
  }
}
Link to comment

Hey @Shadmon thanks so much! However, it doesn't work on iOS devices (ipad & mobile) - sorry, I should've been more specific! 

 

Do you have any workaround for this? 

 

Many thanks! 

 

 

Link to comment

Hey @tuanphan I understand it is not possible with the Will myers code, but I found a website (linked above) that does allow it  to work on mobile. Wondering if you know how I can make it work on mobile?

 

Thanks!

Link to comment
On 5/7/2024 at 7:20 PM, Gigi-C said:

Hey @tuanphan I understand it is not possible with the Will myers code, but I found a website (linked above) that does allow it  to work on mobile. Wondering if you know how I can make it work on mobile?

 

Thanks!

I see they used JavaScript code, But I could not check the exact code/or plugin they used

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

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.