Jump to content
Search Community

Animation is not pinned when I scroll back up fast

mot test
Moderator Tag

Recommended Posts

Hi guys,

I'm new here and have a little problem with an animation, maybe someone has an idea or can help me, I'm not sure if I did it right.

 

I got a box that should appear with the appreance of the parent section, this works.

After that, I pin the box and let it pinned in the background, til a certain point (bottom of the parent section, I get the coordinates with getBoundingClientRect() from a spacer element), and then I want the box unpin / fade out to bottom into the next section, this also works.

 

When you scroll smoothly up and down, everything works as expected, but when you scroll back up fast, it can happen that the box is not visible and not pinned. I have no idea how I fix this.

 

Thank you

See the Pen QWGXNvw by ciruz (@ciruz) on CodePen

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