Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
Romiar

Number Counter Issue

Recommended Posts

Hi.

 

I have a strange issue with TweenMax.

I'm trying to create a counter with TweenMax and when i launch the code, in the update i have these values:

70704
index.ts:17 97500
index.ts:17 129511
index.ts:17 160944
index.ts:17 191799
index.ts:17 -209185
index.ts:17 -179452
index.ts:17 -150297
index.ts:17 -123385
index.ts:17 -95352
index.ts:17 -67897
index.ts:17 -42585
index.ts:17 -16252
index.ts:17 9503
index.ts:17 33215
index.ts:17 57848
index.ts:17 80504
index.ts:17 104015
index.ts:17 126948
index.ts:17 149303

 

can you help me?

 

I'm using this code:

var counter = { var: 0 };
TweenMax.to(counter1, {
    var: "1000000"
    onUpdate: function () {
        console.log(Math.ceil(counter.var));
    }
});

Share this post


Link to post
Share on other sites

Ok.

 

I have founded something strange. 

With values under "214000" it works great, but when i increase this limit, all go wrong.

 

i'm loading the "gsap.min.js" library and i'm using it with Typescript

 

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×