Jump to content
Search Community

just first timeline working

OswaldoV test
Moderator Tag

Recommended Posts

I did this a few weeks ago and was working fine but today just first timeline is working, the others not, I check previous versions on git and are not working neither

 

var tlstart = gsap.timeline();
var tlBg = gsap.timeline({onUpdate:updatePercentage});
var tl = gsap.timeline();
var tl2 = gsap.timeline();
var tl3 = gsap.timeline();
 
const controller = new ScrollMagic.Controller();
 
tlstart.to("#background", 1, {opacity:1}, "+=.3")
.from("nav", .4, { y: "+=10"}, "-=.6")
.from(".anim1", .8, {opacity:0, x:-200, stagger: .4})
.from(".sectionProjects", .2, {opacity:0, y:10}, "-=1");



 
tlBg.to("#background", .2, {opacity:0});
 
tl.from(".anim2", .5, {opacity: 0, x:"-=200", stagger:.2})
.from(".projectThumb1", .4, {opacity:0, x:"+=20"}, "-=.6");
 
 
 
tl2.from(".anim3", .5, {opacity: 0, x:"+=50", stagger:.2})
.from(".projectThumb2", .4, {opacity:0, x:"-=20"}, "-=.6");
 
tl3.from(".anim4",.5, {opacity:0, y: "-=10", stagger: .2});
 
const sceneBg = new ScrollMagic.Scene({
triggerElement: "#background",
triggerHook: "onLeave",
duration: "90%"
})
 
.setPin("#background")
.setTween(tlBg)
.addTo(controller);



 
const scene = new ScrollMagic.Scene({
triggerElement: "#trigger1"
})
 
.setTween(tl)
.addTo(controller);
 
const scene2 = new ScrollMagic.Scene({
triggerElement: "#trigger2"
})
 
.setTween(tl2)
.addTo(controller);
 
const scene3 = new ScrollMagic.Scene({
triggerElement: "#trigger3"
})
 
.setTween(tl3)
.addTo(controller);
 
 
Link to comment
Share on other sites

Hey Oswaldo and welcome to the GreenSock forums!

 

Could you please provide a minimal demo of the problematic code? That means stripping anything that isn't directly related to the error. Using something like CodePen is very helpful as well. You can read more about how to do so here:

 

Also know that ScrollMagic is not a GreenSock product and we don't really support it here. We may or may not be able to help in regards to getting it working :)  

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...