Jump to content

Make image sticky while scrolling down on blog page

Recommended Posts

Posted (edited)

Site URL: https://coolicon.squarespace.com/journal/bedroom

Hello, 

My blog articles have an image on the left, and text that goes with it on the right. I'm trying to have the image to stay in place while scrolling down the page to read the paragraph associated with that image on each blog post. Then once the paragraph is read, the rest of the page scrolls down. 

An example of a site that does what I want is https://www.kinfolk.com/erchen-chang-2/ . The first paragraph and image moving at different times is what I am trying to achieve. 

Can anyone help? Thanks in advance!

 

Edited by ChloeCL
wrong url
Posted
5 hours ago, ChloeCL said:

Site URL: https://coolicon.squarespace.com/journal-content/bedroom

Hello, 

My blog articles have an image on the left, and text that goes with it on the right. I'm trying to have the image to stay in place while scrolling down the page to read the paragraph associated with that image on each blog post. Then once the paragraph is read, the rest of the page scrolls down. 

An example of a site that does what I want is https://www.kinfolk.com/erchen-chang-2/ . The first paragraph and image moving at different times is what I am trying to achieve. 

Can anyone help? Thanks in advance!

 

You can try adding to Home > Design > Custom Css

@media only screen and (min-width: 768px) {
  body {
    overflow: visible;
  }
/*First image block*/
  #block-yui_3_17_2_1_1644327177946_41007 + .row  > .col:first-child {
    position: -webkit-sticky;
    position: sticky;
    top: 0px;
  }
}

Let me know how it works on your site

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Pinch/Zoom images, videos - PDFs Lightbox - ...) </>  🗓️ Delivery Date Picker (Date picker form field)
Gallery block 7.1 workaround </> 🤖 Ask me anything

Posted

Thank you for your answer. I've added your code on my site, but it doesn't look like it changed anything. I've tried with both the block id you gave (the one for the line just above the image) and the block id for the image, and the results were the same. 

Posted
On 3/7/2022 at 3:48 PM, bangank36 said:

You can try adding to Home > Design > Custom Css

@media only screen and (min-width: 768px) {
  body {
    overflow: visible;
  }
/*First image block*/
  #block-yui_3_17_2_1_1644327177946_41007 + .row  > .col:first-child {
    position: -webkit-sticky;
    position: sticky;
    top: 0px;
  }
}

Let me know how it works on your site

Do you have another idea on how to achieve this?

Thanks!

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.