aos icon indicating copy to clipboard operation
aos copied to clipboard

AOS Modify to allow element to disappear when not in viewport regardless of above or below

Open patrickjelon opened this issue 3 years ago • 2 comments

We all know once an aos element is visible in the viewport the aos-animate class is given and the element animates, and when you scroll back up and it leaves the viewport the class is removed. I'd like to also include that if you scroll below, it also disappears so regardless of what direction you scroll in, once the element leaves the viewport the aos-animate class is removed. I can't find any helpful or working solution including a data attribute to make this work. Any ideas?

patrickjelon avatar Nov 07 '21 18:11 patrickjelon

Have you been able to resolve this issue? I'm having a same problem it animates only when I'm scrolling down however when I scroll up it stays static.

lvekua avatar Mar 16 '22 14:03 lvekua

Use the aos 3.0 beta, the feature isn't supported in the latest release version (pretty sure it's 2.3.1). Then just add the attribute data-aos-mirror="true" and it should work perfectly. Obviously using a beta version could cause problems, but I haven't encountered any or other major changes while using it.

patrickjelon avatar Mar 16 '22 16:03 patrickjelon