Hello,
I'm using ScrollTrigger to reveal element on scroll using batch. I would like to add a class inside 'onEnter' parameter. I currently use 'attr' but it erases all my classes. I read I could use classList.add() to do it, but I'm not sure where in the code to place it and how to do it.
ScrollTrigger.batch(".js-reveal", {
interval: 0.1,
onEnter: batch => gsap.to(batch, {autoAlpha: 1, stagger: 0.1, attr: { class: "is-visible" }}),
});
I use a GSAP pen for example.
Thank you.