Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resizing elements on page makes scrollreveal behave erratically. #539

Open
QuietNoise opened this issue Jun 9, 2021 · 3 comments
Open
Labels

Comments

@QuietNoise
Copy link

QuietNoise commented Jun 9, 2021

When resizeable elements on the page resize then tags with scroll reveal that are below on the page do not reveal properly.
They either reveal too late / too early (depending how the said resizeable elements resized: got smaller or got bigger) or not reveal at all (those tags which are placed on the very bottom of the page).
I was hoping the ScrollReveal().sync() would fix that but no hope.
Similarly destroying and rebuilding the reveals doesn't work. I believe it is a bug introduced recently because I recall it was working with sync() before on some older version.

Bug demonstration:
JSBin
https://jsbin.com/vilajuziji/1/edit?html,css,js,output
I've found JSBin very clunky. I've created same demonstation on codepen as well just in case.
https://codepen.io/RhetoricalDude/pen/KKWByoM

In the demo above you have a big blue resizeable element which gets resized when clicked. When resized you can observe that tags below demonstrate the bug as they reveal too late.
In commented JS part there are 3 unsuccessful attempts to use sync() and destroy() which you can play with to see they only make things worse by making reveal stop working altogether.

Edit:
This works as expected in 4.0.5. Calling ScrollReveal().sync() in 4.0.5 properly refreshes all elements controlled by scrollreveal.
Sample with 4.0.5 https://codepen.io/RhetoricalDude/pen/YzZjbwG

Environment

  • Operating System: Windows 10 Pro
  • Browser Version: Chrome 91
  • ScrollReveal Version: 4.0.9
@zhaihongbin
Copy link

I encountered the same situation when using nextjs client routing, but version 4.0.5 still doesn't work

@huskiesdev
Copy link

@jlmakes I provided 3 demos :)

@jlmakes jlmakes added Bug and removed Needs Demo labels Mar 30, 2022
@kannafay
Copy link

Hi there, I changed the page height and I use sync() have not triggered correctly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants