every time I put the code in the elements disappear.
here is an example
<div class="content" data-aos="fade-right">
my content disapeers
<div class="content">
everything stays there
for me too, seems like latest update brought in some bug?
Same here.
Edit: Got it fixed. If you put AOS.init on bottom of your body element then it works.
do i put AOS.init that is my script tag?
The same thing happened here. New to AOS. I did everything under the rules:
<script src="assets/js/aos.js"></script>
<script>
AOS.init();
</script>
</body>
<div class="content" data-aos="fade-up">Anyone have an idea how to fix that issue, @Operator21 @michalsnik?
Edit: The animation seems like is working now.
Though, couple of days ago the HTML had quite strange behaviour. First, the animation didn鈥檛 worked. Then I added the data-aos-delay tag and one worked. Then I removed data-aos-delay and animation again worked. The next day when I opened the website, not only the animation didn鈥檛 worked, but also the DIV element was not displayed.
Strange. I hope everything will remain satisfactory.
@ferretl yes you place it in a script tag.
@goragag Maybe try loading the aos.js in the <head></head> and then initializing at the end of the body.
<head>
<link type="text/css" rel="assets/css/aos.css">
<script src="assets/js/aos.js"></script>
</head>
<body>
<div data-aos="fade-up">
Hello
</div>
<script>
AOS.init();
</script>
</body>
@bfan1256 Thank you. Now AOS works fine. Though I'll write down somewhere your suggestion.
Great! I'm glad AOS works for you! It acts very weird sometimes!
My elements are also disappearing. I added the CSS and JS CDN links in my header and initialized as right before my closing body tag. But my element don't show up. Please help
@ebruin22 , could you show some more information?
Hi there! Please try to add:
window.addEventListener('load', AOS.refresh)
It should solve all your issues. Sometimes DOMContentLoaded event is just too early to initialize AOS, because some images that we load might change positions of our elements on the page, and AOS then might not recalculate their trigger points.
You can also just use startEvent: 'load' seeting instead of adding additional listener.
If this problem will still occur for you please reopen this issue and provide more informations, that would allow us to debug it properly :)
this is not working in my real project, the same hidden problem comes again and again. I have tried all the possible ways to initialise it. But it is still not working for me.
I am having the same issue
the problem is the overflow property in any container tag and the important one is HTML and body you have to cancel it and fix your problem
Most helpful comment
Hi there! Please try to add:
It should solve all your issues. Sometimes
DOMContentLoadedevent is just too early to initialize AOS, because some images that we load might change positions of our elements on the page, and AOS then might not recalculate their trigger points.You can also just use
startEvent: 'load'seeting instead of adding additional listener.If this problem will still occur for you please reopen this issue and provide more informations, that would allow us to debug it properly :)