Jump to content

Removing sticky function from Mobile site only

Go to solution Solved by Ziggy,

Recommended Posts

Posted

Hi there. Does anyone know how I can remove the sticky function from the mobile version of my site. I have used the following code and would like to keep this for my desctop version but remove for mobile.

 

#page .page-section {position: sticky!important; top: 0px; box-shadow: 5px 5px 15px rgba(0,0,0,0.8)!important}
html {scroll-behavior: smooth}

  • Replies 3
  • Views 542
  • Created
  • Last Reply

Top Posters In This Topic

Posted

You need to put the sticky functionality within a media query to only apply it to desktop:

@media only screen and (min-width:768px) {
  #page .page-section {
    position: sticky!important; 
    top: 0px; 
    box-shadow: 5px 5px 15px rgba(0,0,0,0.8) !important;
  }
}

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!

📈 SEO Space (Referral link)
Ⓜ️ 
Will Myers' Plugins & Tutorials (Referral link)
 🔌 Ghost Squarespace Plugins (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲SQSP Themes (Referral link) 
Spark Plugin (Referral link) 
 🖼️Pinch-to-Zoom Gallery Lightbox Plugin (Referral link) 

 Did I help? Buy me a coffee?

Posted

This is amazing thank you. And do you know how I can just have certain cestions on one page sticky? Thank you again.

  • Solution
Posted

You can replace #page .page-section with the section ID.

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!

📈 SEO Space (Referral link)
Ⓜ️ 
Will Myers' Plugins & Tutorials (Referral link)
 🔌 Ghost Squarespace Plugins (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲SQSP Themes (Referral link) 
Spark Plugin (Referral link) 
 🖼️Pinch-to-Zoom Gallery Lightbox Plugin (Referral link) 

 Did I help? Buy me a coffee?

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.