Jump to content
Search Community

batch animation in scroll trigger

lolacommunication test
Moderator Tag

Recommended Posts

var lines = gsap.utils.toArray(".fnr-content__number-content");
 
var tl = gsap.timeline({
scrollTrigger: {
trigger: '.fnr-page-right',
pin: true,
scrub: true,
start: "top top",
end: '+=2000%'
},
stagger:0.5,
toggleActions: "play pause resume reset",
})
tl.to(lines, {top: '50%',opacity: '1',duration: 1, stagger:1}, "ok")
tl.to(lines, {top: '20%',opacity: '0',duration: 1, stagger:1}, "ok")


 

 

It's really buggy on scroll back, so my section get pin and i want that on number comes up after it goes away and next number comes up pls

Link to comment
Share on other sites

Yeah, a minimal demo would help a lot, but you definitely set that up incorrectly because you put both animations at exactly the same place on the timeline, making the lines go to totally different values at the same time. You're saying "animate to opacity: 1 AND opacity: 0 at the same time" (which obviously is impossible). Why are you placing those both at the "ok" label? 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...