data-aos not working in second+ full height div
See original GitHub issueThis is: Possible Bug?
Specifications
- AOS version: 2.3.1
- OS: Windows 10
- Browser: Firefox, Chrome
Expected Behavior
“Div 1” takes up the entire screen (width & height). There are 3 sections in this div that animate. “Div 2” takes up the entire screen, and is placed below Div 1. There are 3 seconds in this div that animate.
Actual Behavior
Everything in “Div1” animates properly. Scroll down to “Div2” -> any section with “data-aos” is invisible. The content won’t show up at all. If I hide Div1, then Div2 works (since it’s the only thing on the page), and visa versa.
Possible Issue
The problem seems to be with scrolling. Maybe the content in Div2, Div3, Div4, etc… isn’t showing up, because somehow AOS isn’t recognizing that the website is being scrolled to this section. So the content is invisible.
Before you ask:
Yes, AOS.init() is fine. As stated, the animations are working. They’re just not working in multiple full-screen divs. I have also read through/tried multiple issues, and haven’tt found a solution
And window.addEventListener('load', AOS.refresh)
is added at the very bottom of my footer file
Issue Analytics
- State:
- Created 5 years ago
- Comments:7
This fixed my problem. Overflow seems to mess with AOS.
SOLVED: After digging through some older threads, I realized the problem was in my main CSS file.
I have BODY, HTML ( overflow-x: hidden; }
This is a little bit of a problem, since I really need to have overflow-x: hidden. Removing this means that AOS works properly, but also means that I can’t have some animations that fly in from the right side of the screen :\ That’s a bit of a bummer, but I’ll have to find a workaround