Jump to content

snap scroll to each section css functionality

Recommended Posts

Posted

hello,

I'm trying to get the snap scroll css feature working. As seen in this codepen example.  (I want to be able to snap scroll section to section vertically.) https://codepen.io/andyadams/pen/omLOqZ

As I understand it, you need to add the css to your container div and then to each section. (wasn't exactly sure what the container div is considered to be so I added that css to both collection and page.) I've added the css below but it doesn't work. Any help would be greatly appreciated! Thanks! Tom

#page {
   scroll-snap-type: y mandatory !important;
}
#collection-60885ba8dcf40e5d7af67055 {
  
  scroll-snap-type: y mandatory !important;
}

section[data-section-id="60885ba8dcf40e5d7af67057"] {
  
   scroll-snap-align: start !important;
  scroll-snap-stop: normal !important;
}
section[data-section-id="60885ba8dcf40e5d7af67059"]{
  
  scroll-snap-align: start !important;
  scroll-snap-stop: normal !important;
}

  • Replies 0
  • Views 950
  • Created
  • Last Reply

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.