Jump to content
Search Community

ScrollTrigger pinned multiply headers

DimaKot test
Moderator Tag

Recommended Posts

Hey there!

 

Welcome to the forums.

In order to replicate sections with timelines you would need to loop round and select elements from within that section to avoid selecting the same elements again.

We have a selector in GSAP that does this, but it is similar to using element.querySelector()

Hope this helps!

See the Pen RwQYYgM?editors=0110 by GreenSock (@GreenSock) on CodePen

  • Like 2
Link to comment
Share on other sites

6 hours ago, Cassie said:

Hey there!

 

Welcome to the forums.

In order to replicate sections with timelines you would need to loop round and select elements from within that section to avoid selecting the same elements again.

We have a selector in GSAP that does this, but it is similar to using element.querySelector()

Hope this helps!
 

 

thank you for fast reply. it was just a fast example.

maybe you can help with headers? 

How can I fix one under one after scrolling and not lose the constructor?

Link to comment
Share on other sites

1 hour ago, Cassie said:

Sure - you'll have to use pinning for the headings

This isn't perfect because you'll need to adjust styles and position the headings and the shoes to get the exact thing you're after, but maybe it'll give you a nudge in the right direction.
 

 

 

 

 

Thanks, this example is closer to what I'm looking for. styles are not the problem. ) I

just started working with this library, I like it very much and I hope someday I will become a pro)

 

 

the first section works as it should. but the second one is not quite. when the second heading touches the first one they both move up, but need them to be pinned and constantly visible

 

 

 

Link to comment
Share on other sites

12 minutes ago, Cassie said:

So glad you're enjoying learning! That's great.

The best way to become a pro is by reading the docs and trying things out. Why don't you give this a go yourself? the docs are here - https://greensock.com/docs/v3/Plugins/ScrollTrigger

If you get stuck or don't understand how something works we're happy to answer specific questions

 

 

 

I have been trying to solve this problem for several days, I have already checked the documentation, YouTube and this forum, but I can not find a solution, something later than this solution. but for all examples, the content changes completely when scrolling. no elements from the previous section remain.

See the Pen YzyqVNe by GreenSock (@GreenSock) on CodePen


so I will be glad for any help to find a solution

 

 

Link to comment
Share on other sites

It's unlikely that you'll find a full solution in the forums, but if you read the docs you'll find the building blocks you need.


Just start with a simple demo with a few heading tags and focus on what you want to achieve.

It's pretty simple to pin an element for the duration of a few sections, but it's very hard to try and reverse-engineer people's demos to do what you want.

Here's a heading being pinned for the duration of a few sections. Have a play around.

See the Pen dydgyNy by GreenSock (@GreenSock) on CodePen

Link to comment
Share on other sites

1 hour ago, Cassie said:

It's unlikely that you'll find a full solution in the forums, but if you read the docs you'll find the building blocks you need.


Just start with a simple demo with a few heading tags and focus on what you want to achieve.

It's pretty simple to pin an element for the duration of a few sections, but it's very hard to try and reverse-engineer people's demos to do what you want.

Here's a heading being pinned for the duration of a few sections. Have a play around.
 

 

 

 

thanks for the ideas.

i found a solution.

It's not perfect, but it might be useful for someone else.

 

See the Pen GRQYgLw by PotapovD (@PotapovD) on CodePen

 

 

 

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