Streaming live at 10am (PST)

Anime.js trigger on InView

I’m using anime.js thanks to the wonderful Timothy Ricks tutorial here: Stagger animations with Anime.js in Webflow - YouTube

I’ve set it up to trigger on my .h2 headings, but I realise the first initiation animates ALL .h2 headings even if they’re off screen. Is there a way to trigger this only on the .h2 heading that is currently in view?

Totally understand why Timothy used an ID instead of a class for this, but it’s not ideal to make IDs for every H2 heading as I’d eventually like to apply this throughout the site.

Any tips would be super gratefully received!

Many thanks,
Gordon


Here is my site Read-Only: Webflow - unfauxgettable v2

Take a look at the seek control. Documentation | anime.js seek (animejs.com)

Here is a stack on the subject → scroll - How to use “seek” in anime.js in order to control an animation while scrolling? With example, please - Stack Overflow

Personally, I prefer to use GSAP and ScrollTrigger