Jump to content
Search Community

Dollar Counter

phillip_vale test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hi,

 

I am trying to make a counter. The namings might seem a bit weird but they are specific to another project that this is for.

 

Basically, once it is in it's final place the activeIndex will be determined by a slider.js that i have running.

 

Once the activeIndex == 1 or 2. it should set a number 49 or 70 that the count() function will count to.

 

Any help would be great!

 

Thanks,

 

Phil

See the Pen zBGLzy?editors=0011 by phillip_vale (@phillip_vale) on CodePen

Link to comment
Share on other sites

  • 1 year later...
  • 2 years later...
7 hours ago, Anmol Juneja said:

Can we add start & end attributes in HTML instead of JS

Sorry, I'm not understanding your question. Could you try rephrasing it? If you mean changing the numbers where "it should set a number 49 or 70 that the count() function will count to", you could use a data attribute and get those values from the HTML in the function instead.

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