Hello, i was re-creating a scrollTrigger action that i saw people using as basic example, just like a fade-in from the left.
I was using this on a production project and i wanted to recreate this scrollTrigger but when i create a timeline it indeed works, but when i try to add another timeline for example let timeline2 = gsap.timeline it stops working.
I also tried the basic .to with start and end but it doesnt "stick" to the top of the section i'm working on but the middle section of another section.
They both animate at the first start marker.
Here's the code.
<script>
gsap.timeline({
scrollTrigger: {
trigger: '.LinhaDeApoio', // This is the Section Class
start:"center",
end: "bottom top",
markers:true
}
})
.from(".DivImagemApoio", {x:-200, opacity:0, duration:2}) // div class i want to animate
let var1 = gsap.timeline({
scrollTrigger: {
trigger: '.Newsletter', // This is the Section Class
start:"center bottom",
end: "bottom top",
markers:true
}
})
var1.from(".leftcontainnews", {x:-200, opacity:0,duration:3}) // div class i want to animate
</script>