jlmakes / scrollreveal

Animate elements as they scroll into view.
https://scrollrevealjs.org/
22.3k stars 2.26k forks source link

Bugs when page height changes #569

Open kannafay opened 5 months ago

kannafay commented 5 months ago

I have found that when the height of a webpage changes, the location of the trigger will change, and even using sync() can cause bugs

This is a normal situation:

https://github.com/jlmakes/scrollreveal/assets/85301126/2bc03cc9-a4cd-4a35-a806-73fe68c4aee3

This is the effect of using ScrollReveal().sync()

bug

https://github.com/jlmakes/scrollreveal/assets/85301126/be7983f7-833a-437f-ac20-1846ffd9fc49

I don't know what's wrong. I trigger ScrollReveal().sync() when I click collapse panel, but it seems that something's wrong with it

Environment

kannafay commented 5 months ago

hi bro ,who can help me

GeistFighter commented 3 months ago

Hello, I have the same problem 😥 Have you found a solution ?

GeistFighter commented 3 months ago

same problem here #565

kannafay commented 3 months ago

same problem here #565

However, it does not solve my problem

kannafay commented 3 months ago

same problem here #565

I need to recalculate the height when triggered, but it doesn't take effect

GeistFighter commented 3 months ago

I found the function ScrollReveal().delegate(); which I use instead of ScrollReveal().sync(); and it now works for me, as if it recalculates the size

GeistFighter commented 3 months ago

567