Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0

Help changing background image on mobile please?


Murso500

Question

Site URL: https://guava-guppy-sx4w.squarespace.com/

 

URL: https://guava-guppy-sx4w.squarespace.com/

PW : test 

Hi,

I've been able to follow a number of forum topics on this subject but cant seem to get the code to work. 

Have two backgrounds set on the home page, would like to hide the landscape one in mobile and the portrait one in desktop / tablet modes.  Tried to locate the section ID's but that didnt seem to work. 

Should end up looking like the images below.

Many thanks!

 

1610502755_Screenshot2020-12-10at09_23_09.thumb.png.83cbe05390b8049640c796d52845818b.png135826879_Screenshot2020-12-10at09_23_26.thumb.png.f57cd163fd9211942f6ca47740362963.png

Link to post
  • Answers 2
  • Created
  • Last Reply

Top Posters For This Question

Popular Days

Top Posters For This Question

Popular Posts

Site URL: https://guava-guppy-sx4w.squarespace.com/   URL: https://guava-guppy-sx4w.squarespace.com/ PW : test  Hi, I've been able to follow a number of forum topics on this subj

Thanks for this @bangank36, the tip for the chrome ID finder is great!  I couldn't get your code to work but finding the right ID allowed me to use a different code I was playing with prior which

Posted Images

2 answers to this question

Recommended Posts

  • 0
19 minutes ago, Murso500 said:

Site URL: https://guava-guppy-sx4w.squarespace.com/

 

URL: https://guava-guppy-sx4w.squarespace.com/

PW : test 

Hi,

I've been able to follow a number of forum topics on this subject but cant seem to get the code to work. 

Have two backgrounds set on the home page, would like to hide the landscape one in mobile and the portrait one in desktop / tablet modes.  Tried to locate the section ID's but that didnt seem to work. 

Should end up looking like the images below.

Many thanks!

 

1610502755_Screenshot2020-12-10at09_23_09.thumb.png.83cbe05390b8049640c796d52845818b.png135826879_Screenshot2020-12-10at09_23_26.thumb.png.f57cd163fd9211942f6ca47740362963.png

You can follow these steps:

1. Find the section id via this extension

Chrome Web Store - Extensions (google.com)

2. Click on it icon to get the id and replace in the below snippet (which I help you find already)

@media only screen and (max-width: 640px) {
      section[data-section-id="5fd13362283fb005030b266b"] .section-background {
        background-image: url("https://images.squarespace-cdn.com/content/v1/5fa468b9be882012fbd59ab2/1607594230382-R11FF85OTT6H1NXNN9PP/ke17ZwdGBToddI8pDm48kGzoLUibUFZ8FEdlbHgnGb97gQa3H78H3Y0txjaiv_0fDoOvxcdMmMKkDsyUqMSsMWxHk725yiiHCCLfrh8O1z5QHyNOqBUUEtDDsRWrJLTmci781IWyUbYPSwZLERvZocHiUFKcWq0joGojCpOEnQ_66Ow-oYb1umVRKEE_zXj0/CS-GIF-HOMEPAGE-tall.gif");
        background-size: cover;
        background-repeat: no-repeat;
      }
      section[data-section-id="5fd13362283fb005030b266b"] .section-background img {
        opacity: 0;
      }
}

image.png.61a2f37a9d92bdd01a595f45d13d1a5e.png

Greeting, it's BaNgan from BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, 360 Degree Photo block, Seperator Block (SVG Shape divider for sections)
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to post
  • 0

Thanks for this @bangank36, the tip for the chrome ID finder is great! 

I couldn't get your code to work but finding the right ID allowed me to use a different code I was playing with prior which works perfectly. 

Solved! 

M/. 

Link to post

Create an account or sign in to comment

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


×
×
  • Create New...