Jump to content

Sticky scroll applied to specific section ID

Recommended Posts

Posted

Site URL: https://www.poppyandseedstudio.com.au/

I want the 'Discovery, Development & Delivery' cards to stack on top of each other as you scroll for mobile view only.

 

This is the code I've got however its not working - 

 

@media only screen and (max-width: 768px) {
    section[data-section-id="67050ce4e28f7b16df3c1b78"] {
        position: relative;}


    section[data-section-id="67050ce4e28f7b16df3c1b78"] #block-yui_3_17_2_1_1728383974721_11285,
    section[data-section-id="67050ce4e28f7b16df3c1b78"] #block-730e5033a4235ddda5e2,
    section[data-section-id="67050ce4e28f7b16df3c1b78"] #yui_3_17_2_1_1728428847905_511 {
        position: -webkit-sticky;
        position: sticky;
        top: 0; /* Stick to the top of the viewport */
        z-index: 10;}


    section[data-section-id="67050ce4e28f7b16df3c1b78"] #block-yui_3_17_2_1_1728383974721_11285 {
        z-index: 30;
    }

    section[data-section-id="67050ce4e28f7b16df3c1b78"] #block-730e5033a4235ddda5e2 {
        z-index: 20;
    }

    section[data-section-id="67050ce4e28f7b16df3c1b78"] #yui_3_17_2_1_1728428847905_511 {
        z-index: 10;
    }
}

  • Replies 1
  • Views 412
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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.