Jump to content
Search Community

Refreshing scrolltrigger points on element resize

Jamie-Robertson test
Moderator Tag

Recommended Posts

Hi all,

im having trouble getting my scrolltriggers to refresh on an inner element resizing, demo attached.

 

What im looking to do is when a card scrolls into view, expand the inner area and display the text and image, then collapse and trigger the next card.

 

im sure this is possible, but proving tricky...

 

any input would be appreciated.

 

Jamie

See the Pen zYpxoKP by ru7hl355 (@ru7hl355) on CodePen

Link to comment
Share on other sites

@Cassie thanks, i have also tried it as 1 timeline and i got to were you did, it may be the way forward but as you said its the constant height changes that need considered and im not sure how best to approach that...

 

the other issue i have is i want to pin the open card for a set time before collapsing again, but as soon as PinSpacing is enabled, i get a big gap between the headings.

Link to comment
Share on other sites

Ok, well that's going to be an issue! A scrubbed animation is tied to the scroll distance which is controlled by the user.

There's no concept of  'a certain amount of time' within a scrubbed animation, just a scrolling distance. The user could be scrolling fast or slow.

If you want to pin the card open for a set time you'll need to rethink this!

Link to comment
Share on other sites

Several people have asked about this effect, and my advice is to do something else as this is super complicated. The problem is that collapsing the previous section will move everything up, so what was once in the middle of the viewport will be shifted up. It might be easier if you just expanded everything and forgot about the collapsing part.

 

 

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