Closed cmalpeli closed 1 year ago
Confirmed the issue, i will need to add a check after to readd elements in view and most likely a throttle.
Hi @volkandkaya did you happen to have a chance to look into this issue?
It would be good to get a fix for this :)
Fixed, please give it a try.
Thanks for looking into that and updating it.
It does seem to work for the most part but the animation is still triggered again when the browser is resized. I wasn't too concerned on desktop but when I scroll down in iOS Safari's UI minimises and when you scroll up to reveals again, this seems to be triggering the animations (I guess it's a viewport or window size change?).
I can provide an example site I'm working on but I'd have to share that privately.
I didn't think about mobile height changes, so I removed some code that might have fixed that (reduce bundle size).
I will test tomorrow on a Safari device.
Cool, thanks. I'm not great with JS so I don't have my own suggestions to make but with the help of a certain AI I did come up with this temporary solution that may help, or not. https://gist.github.com/RyanRoberts/6260530cf100c37a1f3bb3795dcbd1a3/revisions?diff=split
Thanks for looking into it.
When resizing it needs to rerun initElement to get offsets and set the trigger for each element. I had some performance and other issues. This seemed to be the best solution.
Updated can you try 1.0.5 @RyanRoberts
That's working great! Thanks for the update.
Thanks @volkandkaya - I think this may still be an issue on desktop resize. Was this fix just for mobile?
What issue are you having on desktop resizing @cmalpeli ?
I fixed the issue where it didn't come back after resizing and reanimates.
@volkandkaya on desktop, if I resize, the previously animated content disappears and then re-animates on the next scroll event.
@volkandkaya if you see here on the example site, all the animated content disappears and then re-animates on scroll when you resize the window:
Great library! I noticed that resizing the browser on desktop causes the previously animated content to disappear. It doesn't seem to re-animate consistently either after resize. Is this s known issue? You can replicate it on the demo site.