Jump to content
Search Community

Timeline Not Playing

bichant test
Moderator Tag

Recommended Posts

This seems simple enough but for some reason it is not working for me.

 

I have a tween inside a timeline that should play when the 'Change Mode' button is clicked.

The opacity of the box should fade to 0 over three seconds and repeat.

Click the button and nothing happens.

 

If you move var tl = to the tween, and comment out the timeline, it works as it should.

 

Thanks for the help!

See the Pen MWwKZLG by bichant (@bichant) on CodePen

Link to comment
Share on other sites

2 minutes ago, bichant said:

If you move var tl = to the tween, and comment out the timeline, it works as it should.

 

If you want to control a timeline, then you need to add animations to the timeline. Right now your timeline is empty.

var tl = gsap.timeline({
  paused: true
})
.to("#rect", {
  opacity: 0,
  duration: 3,
  ease: "back",
  repeat: -1
});

 

  • Like 3
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...