Jump to content

Split Sticky Sections

Recommended Posts

Im using a Brine template, I haven't built out the page yet, but I would like it to be exactly as the reference site, which I believe is split blocks and then use of the sticky javascript but I cant find a code injection to help me anywhere that works within the sqaurespace platform.

Link to comment
  • 4 months later...

Hi there! Adding to this conversation because I'm also interested in how to code sticky sections like the one cited above. I'm using 7.1 and have a similar look on my about page that I split into 1/2 sections, but it doesn't force a scroll. Your mouse has to be over the neutral color area on the right side to scroll through the "what does selah mean?" section.

Any ideas? @ecweb @tuanphan

 

Link to comment
  • 1 month later...
  • 4 weeks later...
On 11/4/2020 at 5:27 PM, bangank36 said:

This is also an interesting topic for me too! I actually made a plugin for my client site as

Charlie Edmiston Paintings — 2020 — Charlie Edmiston Studio

So for specific section I can suggest you do following to apply as hotfix, if you need a universal method let's pm me

1. Remove background of section, instead create a span-6 solumn and add the image block on the right of your text

2. Remove the margin and padding of section, make it 100% width

3. Use Css sticky to apply effect

Output: http://beyondspace.tk/wp-content/uploads/2020/11/sticky.gif


section[data-section-id="5ebdbd0ce45b605e7b5758b0"] .content-wrapper {
        padding: 0;
        margin: 0;
        max-width: unset;
}
section[data-section-id="5ebdbd0ce45b605e7b5758b0"] .content-wrapper .content {
  width: 100% !important;
}
/* Assume you got span-6 image column added*/
section[data-section-id="5ebdbd0ce45b605e7b5758b0"] .content-wrapper .content [data-type="page-section"] > .row .span-6:first-child {
    position: -webkit-sticky;
    position: sticky;
    top: calc(6vw + 29px);
}
/* I want to make sure image is shorter than content */
section[data-section-id="5ebdbd0ce45b605e7b5758b0"] .content-wrapper .content [data-type="page-section"] > .row .span-6:first-child .sqs-block-image-figure > div {
    padding-bottom: 50% !important;
}
section[data-section-id="5ebdbd0ce45b605e7b5758b0"] .content-wrapper .content [data-type="page-section"] > .row .span-6:first-child .sqs-block-image-figure img {
    height: auto !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
}

 

Hi @bangank36

I am trying to create a similar sticky item to the one you have create here: https://www.charliee.com/paintings/2020 

Would you be able to explain how I might be able to get my left column on this page to be sticky (and stay at the top) whilst scrolling through the series of works (photos and text on right)?

I have tried playing around with the code you have provided here but haven't been had any luck with getting it to stick.

https://apricots-accordion-t856.squarespace.com/

Pword: enter

 

Thanks in advance if you have a moment to help with this. 

Sam

Link to comment
14 hours ago, longleys said:

Hi @bangank36

I am trying to create a similar sticky item to the one you have create here: https://www.charliee.com/paintings/2020 

Would you be able to explain how I might be able to get my left column on this page to be sticky (and stay at the top) whilst scrolling through the series of works (photos and text on right)?

I have tried playing around with the code you have provided here but haven't been had any luck with getting it to stick.

https://apricots-accordion-t856.squarespace.com/

Pword: enter

 

Thanks in advance if you have a moment to help with this. 

Sam

Thanks @bangank36

Sorry I forgot the actual page. It's this one: https://apricots-accordion-t856.squarespace.com/work/foundation

 

Thanks again

Shaya 

Link to comment
  • 3 weeks later...

I know!! I'm sorry 😞 I was just trying to figure out what the column width would be for the code to work.

 

But the new code is still not working, any ideas? What do I have to do in order to have the images on the left stick??

Link to comment

@bangank36 Let me know if there is a layout that is easiest. I don't quite understand the code, especially 

.sqs-layout .row .span-2

and

 

.sqs-layout .row .span-4

 

Do you mind explaining to me what they mean?

 

Right now I have 5 overall spacer blocks spread across, and mini spacer blocks underneath the 3rd spacer blocks to make the logos smaller.812202429_ScreenShot2021-01-07at7_33_36PM.thumb.png.316114f2ec6a7aabe77893b40dba0005.png

Edited by vvc
Link to comment

@bangank36 Thank you, that's what I figured.

Would it be easier if we made the "background" sticky rather than the code blocks sticky?

So I have this code in another section that automatically splits the screen and makes the background image 50%:

 

section[data-section-id="5fe8fd485e66733f024138be"] {
  background-color:#fff;
  @media(min-width:767px){
    .section-background{
      width:50%;
      margin-left:50%;
    }
    .content-wrapper {
      width:50%;
      margin-right:50% !important;
    }  
    
  }
  @media(max-width:767px){
    display:flex;
    flex-direction:column;
    .section-background, .content-wrapper{
      position:relative;
    }
    .content-wrapper{
      order: 1
    }
    .section-background{
      height:200px;
      order: 2;
    }
  }
}

 

Thank you so much for your help!

Link to comment
  • 1 month later...
  • 1 month later...
  • 3 weeks later...

Hey @bangank36! I've been fiddling around with this for a while and some of your previous posts have already helped me greatly, but I'm having an odd problem I can't seem to figure out.

https://mbmtest3.squarespace.com/

pw: middleborn

Thanks to you, I've managed to get that menu section on the left to behave how I want, but I can't figure out how to get rid of that big yellow box where the section would normally be. I'd like the content below to be right beneath the header video.

 

I'm guessing this problem has something to do with the fact that I'm making an entire section sticky, rather than just a column in a section, but I'm not sure. What's odd is when I set the menu section's position to "fixed" instead of "sticky", the content beneath that section behaves how I want. See below:

370079272_Screenshot2021-04-08181015.thumb.png.e0d4814fd1ab46ea6655e96affc21315.png

 

Any ideas on how to handle this?

This is all the custom code I'm using on this page:

(Apologies for the mess)

<style>
@media screen and (min-width:641px){
  #header {
    display: none;
  }
  .page-section:nth-child(2){
    width:20vw;
    z-index: 9999;
    position: sticky !important;
    background-color: transparent !important;
    top: 0;
  }
  .page-section:nth-child(2) .section-background{
  background: transparent !important;
  }
/* Menu Logo Edits */
  .page-section:nth-child(2) .image-block{
    width: 15vw !important;
    max-width: 250px !important;
    text-align: center !important;
  }
/* Menu Button Edits */
  .page-section:nth-child(2) .sqs-block-button-container--center {
    text-align: left !important;
    padding-right: 3vw !important;
  }
  .page-section:nth-child(2) .sqs-block {
    padding-top: 3px !important;
    padding-bottom: 3px !important;
  }
  .page-section:nth-child(2) .sqs-block-button-element {
    padding-left: 5vw !important;
    padding-right: 5vw !important;
  }
/* Menu Left Justify */
  .page-section:nth-child(2) .content-wrapper {
    padding-left: 0vw !important;
    text-align: left !important;
  }
/* content to the right */
  .content-wrapper {
  justify-content: flex-end !important;
  }
}
@media screen and (max-width:640px){
  section[data-section-id="606f7adc828e892e3eaa0bc7"] {
    display: none;
  }
}
</style>

 

Link to comment
6 minutes ago, bangank36 said:

may you try this


@media screen and (min-width: 641px) {
    .page-section:nth-child(2) {
        min-height: inherit !important;
        position: sticky !important;
        top: 10vh;
    }
    .page-section:nth-child(2) .content-wrapper {
      padding-left: 0vw !important;
      text-align: left !important;
      position: absolute;
      top: 0;
  }
}

image.thumb.png.74269cacc3e72586efd3fabcf259bd40.png

Haha wow, yeah that did the trick. It's perfect!

Thank you so much!

Link to comment
  • 1 month later...
On 11/4/2020 at 11:57 AM, bangank36 said:

This is also an interesting topic for me too! I actually made a plugin for my client site as

Charlie Edmiston Paintings — 2020 — Charlie Edmiston Studio

So for specific section I can suggest you do following to apply as hotfix, if you need a universal method let's pm me

1. Remove background of section, instead create a span-6 solumn and add the image block on the right of your text

2. Remove the margin and padding of section, make it 100% width

3. Use Css sticky to apply effect

Output: http://beyondspace.tk/wp-content/uploads/2020/11/sticky.gif


section[data-section-id="5ebdbd0ce45b605e7b5758b0"] .content-wrapper {
        padding: 0;
        margin: 0;
        max-width: unset;
}
section[data-section-id="5ebdbd0ce45b605e7b5758b0"] .content-wrapper .content {
  width: 100% !important;
}
/* Assume you got span-6 image column added*/
section[data-section-id="5ebdbd0ce45b605e7b5758b0"] .content-wrapper .content [data-type="page-section"] > .row .span-6:first-child {
    position: -webkit-sticky;
    position: sticky;
    top: calc(6vw + 29px);
}
/* I want to make sure image is shorter than content */
section[data-section-id="5ebdbd0ce45b605e7b5758b0"] .content-wrapper .content [data-type="page-section"] > .row .span-6:first-child .sqs-block-image-figure > div {
    padding-bottom: 50% !important;
}
section[data-section-id="5ebdbd0ce45b605e7b5758b0"] .content-wrapper .content [data-type="page-section"] > .row .span-6:first-child .sqs-block-image-figure img {
    height: auto !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
}

 

Hi @bangank36, I was wondering if you could help me out with the split sticky section as well, i want to make something like https://www.breakthroughenergy.org/our-challenge/the-grand-challenges the sticky section here or like this https://habitat-tw.com.au/

I do not know where to start and how to split the sections, could you please help me out?

Link to comment

Site URL: https://habitat-tw.com.au/

Hi!

 I need help with making sticky split sections in my squarespace website, something along the lines of what https://habitat-tw.com.au/ or the challenges section in this page https://www.breakthroughenergy.org/our-challenge/the-grand-challenges, where the two sections move synchronously.

 

my squarespace website url is https://sepia-cinnamon-pcxj.squarespace.com/

and password is: candela 

I want to implement this feature on the last mile grand challenges page, which will have 4 "challenges" or blocks, meaning 8 blocks in all (2 by 4)

thanks in advance!

Link to comment
  • 6 months later...

@ecweb@stapleshotz, @sehar, @HaleyWard

Did you manage to get Sticky Split Sections to work?  SquareKicker just released a tool that gives you the ability to achieve this with one click.  Check out the video tutorial at the link below. 

https://squarekicker.com/letsmakethis/stickysplit

 

1979610747_StickySplitSections.thumb.png.dd8efc9cac45989a636ca9269a8f4362.png

If your just using SquareKicker for this single feature, you can use SK for one month as a one off and changes save forever.

SquareKickerHi, I'm Nick, CEO & Co-Founder at squarekicker.com.  Take your Squarespace sites to the next level with SquareKicker's No-Code Design & Animation Extension. Break free from templates & complex code and start building unique websites that you are proud to show your clients without ever having to write a single line of code. 

Squarespace Extension  ●  Templates  ●  News  ●  Inspiration  ●  Tutorials  ●  Resources

 

Link to comment

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.