Jump to content

Create a sticky section that starts scrolling once it hits the next section

Go to solution Solved by paul2009,

Recommended Posts

  • Solution
Posted
20 minutes ago, MadihaSyed said:

Basically, I would like to know how to achieve this scroll effect in my website

The block containing the H1 headline ("Zendaya") has simply been fixed in position using Custom CSS (using 'position:fixed'). this stops it moving up with the rest of the section (the image). 🙂

fixed.thumb.gif.5375863c5b866b69dd77bff74d43b6f5.gif 
With the CSS

not-fixed.thumb.gif.a2f9ac4fe3e77ecf3bd528f0ef9ca333.gif
Without the CSS

Did this help? Please give feedback by clicking an icon below  ⬇️

Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥.
Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. 
Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links.
Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional.

Posted

Hey, thanks for the help! I did fix the position in the CSS, but now its overlapping across the entire page over the rest of the sections? is there a way to put it behind all of the other sections so its not visible after scrolling? Thanks!

  • 4 months later...
Posted

Hey @tuanphan thanks for getting back in touch.

 

Sure - it's here...

https://jaguar-raccoon-nwkn.squarespace.com/

PW BenEditsMusic123

 

Client is trying to achieve the same effect as the Zendaya site, where the BEN EDITS MUSIC text is fixed and scrolls behind the image.

I've been using this code...


//--Scroll Behaviour--//

#block-yui_3_17_2_1_1660167861306_308882 {
position: fixed;
width: 92%;
height: 200px;
top: 100px;
}


Which now seems to be working. Previously I had the text in a different font, and it all seemed rather glitchy - it kept extending out at the side after working initially? All seemed very odd.

Whilst i've got you, I don't suppose you know why some of the corners aren't appearing rounded within the FILM & TV section?

First example below...

 

//specify with the class name
.titles1:hover:before {
  content: '';
background: url('https://static1.squarespace.com/static/62ed106ac3eadf037cbe518d/t/62f2794b1cf4867de0901e3d/1660057931457/Ridley+Jones.jpeg');
  background-size:contain;
  background-repeat:no-repeat;
  border-radius: 20px;
width: 25vw; 
left: 50vw; 
height: 30vh; 
margin-top:-50px;
position: absolute;
opacity:1;
transition: transform .4s cubic-bezier(.86,0,.07,1),opacity .4s cubic-bezier(.86,0,.07,1);
   transform: translate3d(.33333vh,-11.66667vh,0);
  -webkit-animation: flip-in-hor-bottom 0.5s cubic-bezier(0.165, 0.840, 0.440, 1.000) both;
            animation: flip-in-hor-bottom 0.5s cubic-bezier(0.165, 0.840, 0.440, 1.000) both;


      
}

// End Ridley //


Thanks again,
Adam

 

 

Screenshot 2022-08-18 at 11.29.03.png

Graphic Design / Football / Music

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.