Open meko-deng opened 4 years ago
Did you solve your issue ? Could you help me set up AOS in next.js ?
Same issue
Same issue
Check my repo "Aos-implementation", check how I configured _app.js and how I am using aos in the sectionOne.js for example (In the component folder) for example. Working out of the box on Safari, Chrome, Firefox, DuckDuckGo.
Here you can have a quick look to see that it's working, and animation gets reset every time you scroll back up :
aos-implementation-git-main.egamopi.vercel.app
Same issue
Check my repo "Aos-implementation", check how I configured _app.js and how I am using aos in the sectionOne.js for example (In the component folder) for example. Working out of the box on Safari, Chrome, Firefox, DuckDuckGo.
Here you can have a quick look to see that it's working, and animation gets reset every time you scroll back up :
aos-implementation-git-main.egamopi.vercel.app
Thanks @EgamoPi , It Work successfully 🔥
Do we have any fix for this issue? anyone's reply will be helpful. Thank you!
It works perfectly for me That's how I am configuring my _app.js : IMPORTS :
import AOS from 'aos';
import 'aos/dist/aos.css';
import { useEffect } from 'react'
AOS INIT
useEffect(() => {
AOS.init({
delay: 400,
duration: 800,
});
});
In development environment : Every time I add data-aos attributes to elements, I have to hard reload the tab in the browser to get the changes work ( I think it is due to the caching of css files ).
In production It works perfectly. I hope that this will help you.
Can anyone help me with this? I'm using NEXT js + AOS, facing the same issue. But animations are working on the latest browsers of Chrome, Firefox, and Safari. But for some old versions of the browser, elements in view on load are properly animated, the rest of my elements do not get the AOS animations and they get disappear. Only the elements which have no AOS animations are visible on the scroll
Can anyone help me with this? I'm using NEXT js + AOS, facing the same issue. But animations are working on the latest browsers of Chrome, Firefox, and Safari. But for some old versions of the browser, elements in view on load are properly animated, the rest of my elements do not get the AOS animations and they get disappear. Only the elements which have no AOS animations are visible on the scroll
Hello @NitinHirve Please make sure to set data-aos-duration and data-aos-delay attributes for every component. Or you can just do this globally in _app.js file as I mentioned in my previous response above.
Hi @zeghmouri I tried the below code in _app.js but still facing the same issue
useEffect(() => { Aos.init({delay:400 ,duration: 1300}); })
I have tried to apply it inside the nested component, which is not working : the main class is not being added "aos-animate".
I'm working with NextJs and the
aos-init
classes on my elements are applied and only the elements in view on load are properly animated. The rest of my elements do not get theaos-animate
class applied on scroll. There seems to be some kind of interference with the scroll listeners. Help!This is:
Specifications
Expected Behavior
aos-animate
class being applied on scrollActual Behavior
aos-animate
class not being applied on scroll. Only on load on elements in the viewport.Steps to Reproduce the Problem
N/A
Detailed Description
aos-init
classes are being appliedaos-animate
classes are only being applied on load to the elements in the viewportaos-animate
classes are not being applied on scrollOne solution I've tried so far is manually adding an event listener and triggering
AOS.refresh()
but the animation isn't smooth and does not work as well as how it should behave (also a very sketchy patch)Thanks!