Jump to content
Search Community

ScrollSmoother documentation precision

Alex.Marti test
Moderator Tag

Go to solution Solved by Cassie,

Recommended Posts

Hi,

Thanks again for your amzing plugins! I'm always excited when there's a new release.

 

I read the documentation for the new ScrollSmoother plugin and I had a hard time making it works because I wasn't sure about the doc.

 

When you say

<div id="smooth-wrapper">
  <div id="smooth-content">
    <!--- ALL YOUR CONTENT HERE --->
  </div>
</div>

You mean

<div id="smooth-wrapper">
  <div id="smooth-content">
    <!--- ALL YOUR CONTENT HERE --->
<header></header>
<main></main>
<footer></footer>
  </div>
</div>

It is correct? Basically I have to put ALL my page content between these two divs?

See the Pen GRyOavW by iamalexm (@iamalexm) on CodePen

Edited by Alex.Marti
post not finised
Link to comment
Share on other sites

Thank you @GreenSock for your answer.

 

I forgot to put the divs an ID indeed, thanks for pointing that out.

 

But my question was more about the documentation. Just to be sure, do I have to wrap my entier content between the divs?

 

If I do someting like that will it work as well?
 

<header></header>
<div id="smooth-wrapper">
	<div id="smooth-content">
		<!--- My content here --->
	</div>
</div>
<footer></footer>

 

Alex

Link to comment
Share on other sites

There is a caveat for fixed elements, which it talks about in the Caveats section of the docs.

 

Quote
  • position: fixed won't work - since the content has a CSS transform applied, browsers create a new containing block and that means position: fixed elements will be fixed to the content rather than the viewport. That's not a bug - it's just how CSS/browsers work. You can use ScrollTrigger pinning instead or you could put any position: fixed elements OUTSIDE the wrapper/content.

 

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...