-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Animations triggering very late / on the wrong trigger point (for big viewports) #135
Comments
Hey, it looks like you call AOS before the elements are properly placed in your browser. If you load images that are pushing your other elements down after they load you might want to add
Also make sure you initialize AOS right before closing |
@michalsnik thanks!. |
Hey. Defer makes sure your script doesn't block initial DOM render, so it loads your script after DOM is ready. It's great, but when DOM is ready it doesn't mean your images are. If images don't have a height set they will enlarge as they load, pushing your other elements down. So when you init AOS on The best solution however is as follows:
|
Thanks. It's probably that then. Just for investigative reasons I'll try to make a minimal test case without images. |
Might I recommend you add this to the README? I lost a lot of time before finding this closed issue. In my case I'm using Imgix.js and that triggered this issue in Safari. But this fixes it:
Thanks! |
I'm planning to add whole FAQ section with all repeatedly asked questions @ryandeussing :) |
Hey, It would be really great if this is added to the README, I had to go through quite some issues to identify which one was relevant. But hugely appreciated @gkatsanos for the debugging explanation, I had exactly the same, and @michalsnik thanks for the solution! Cheers |
Having the same issue on WordPress, and the problem is exactly caused by an images lazy loading plugin, when I disable it, AOS works just fine, otherwise, the animations trigger more and more late as I scroll down, I understand the issue by reading the comments here, but how do I solve it? I've tried this solution:
but still having the problem. |
For some reason that I can't seem to understand, the animations trigger when the element in question reaches the top of my viewport.. (so, very late..) I've tried both the default, as well as
data-aos-anchor-placement="top-center"
.I'm initializing the plugin as such:
Here's a video of the problem: https://expirebox.com/download/be03de89751f76c62f5f8912a96eb275.html
What makes this even MORE weird is that it works when I serve my website from a dev server (browsersync actually) . and it also works as intended when I make the viewport size a bit narrower or shorter...!
The text was updated successfully, but these errors were encountered: