Jump to content
Search Community

Scrollsmoother with scollable area inside sticky section

babis test
Moderator Tag

Recommended Posts

Hi guys, i want in this code, when i scroll to green section to be sticky and as this is sticky, the right content to be scrolled .And when it finishes, to continue scrolling to section 3. I managed to make it sticky but as soon as the green section become sticky, then the content behind was scrolling and not the inside content. I hope you understand...

See the Pen vYjxVQY by babistsour (@babistsour) on CodePen

Link to comment
Share on other sites

Hi,

 

First you should remove the margin in the parent element, so the green element can use the entire width of the screen:

.how-work {
  margin: 32px; /* <- THIS */
  display:grid;
  place-items:center;
  border-radius: 20px;
  height:99vh;
  color: white;
}

If you're animating the width property, transform origin is not needed, since that applies only to CSS transform properties.

 

This works similar to the example you provided.

tl.fromTo(
  ".how-wrapper",
  { width: "70%" },
  { width: "100%", ease: "none" },
  "<"
);

Happy Tweening!!!

  • Like 2
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...