michalsnik / aos

Animate on scroll library
MIT License
26.51k stars 2.57k forks source link

AOS - Modify the Maximum Delay #816

Open manudev-1 opened 1 year ago

manudev-1 commented 1 year ago

This is:

Specifications

Expected Behavior

I am trying to develop an information site, and i am adding a part of the site dedicated to the resources of the informations, I have 10 resources and I want to animate them based on their index for example: The first source will have 0 (data-aos-delay="400*index") delay, for the second 400 of delay and so on until reach 10.

Actual Behavior

The actual problem is that AOS allow a maximum of delay of 3000, and I was wondering if there is a way that allows you to change this maximum.

qwq0119 commented 5 months ago

You can add custom delays through the following actions

body [data-aos-delay='4000'].aos-animate {
  transition-delay: 4000ms;
}

In fact, the author has built in this method, gradually increasing the built-in style from 50ms to 3000ms. Of course, you can also directly modify the delay through row class styles,

:style="{ transitionDelay: index * 2000 + 800 + 'ms' }"