Jump to content
Search Community

array of labels

Fax
Moderator Tag

Recommended Posts

Posted

Hi,

this is my first post and I start with a stupid question: can I create an array of labels set in my timeline?

 

Thank you.

Posted

Hi @Fax welcome to the forum!

 

There are no stupid questions, but if I'm wondering something like this I start opening a Codepen setting up the basics I need and then console.log() the things I have, to see if I can find what I Need. With your future questions please always include a demo with your questions, even if it is an easy one. It is so nice to just jump directly into your code to test a theory we have and indeed timeline.labels gives you an object of all the labels in your timeline with their timestamp. If you must have an array you could easily convert it to a array with some JS logic  Hope it helps and happy tweening! 

 

 

https://gsap.com/docs/v3/GSAP/Timeline/labels/

 

See the Pen JjQWyBL?editors=1111 by mvaneijgen (@mvaneijgen) on CodePen.

  • Like 2
Posted

Thank you @mvaneijgen for suggestions.
For the next posts I will try to be more precise, maybe even with a Codepen :)

  • Like 1

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