最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Use 'aos' to trigger animation on first element, but then the other elements should trigger without

programmeradmin0浏览0评论

I have multiple HTML elements over multiple rows that I want to animate as 'zoom in' in a sequence.

When the user scrolls down, I want to animate the first item when it arrives in the viewport, and am currently using aos with the following:

<div class="col-lg-4 col-md-6 mb--30" data-aos="zoom-in" data-aos-duration="400" data-aos-once="true"
              data-aos-delay="50">

I then want to trigger the zoom in animation for the other 7 elements with a delay of 100 for each one, but I do not want this linked to the scroll. I want them all to trigger after the first item has been scrolled to, including the ones out of viewport at the time.

Is this possible with aos?

I have multiple HTML elements over multiple rows that I want to animate as 'zoom in' in a sequence.

When the user scrolls down, I want to animate the first item when it arrives in the viewport, and am currently using aos with the following:

<div class="col-lg-4 col-md-6 mb--30" data-aos="zoom-in" data-aos-duration="400" data-aos-once="true"
              data-aos-delay="50">

I then want to trigger the zoom in animation for the other 7 elements with a delay of 100 for each one, but I do not want this linked to the scroll. I want them all to trigger after the first item has been scrolled to, including the ones out of viewport at the time.

Is this possible with aos?

Share Improve this question asked Jun 14, 2020 at 23:32 benjo456benjo456 3461 gold badge3 silver badges13 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 6

You need to set the anchor property.

This will then use the anchor to trigger the animations

For example:

<div id="parent">

    <div data-aos="fade-in" data-aos-anchor="#parent"></div>

</div>

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论