Jump to content
Search Community

hugo_rune

Members
  • Posts

    4
  • Joined

  • Last visited

Posts posted by hugo_rune

  1. I've been trying to animate a number increment from 0 to 250,000

    Interestingly, GSAP 3.0.1, once it gets above 214,000 (ish) it changes the number to a negative and counts down..

    When using TweenMax (latest) the code functions as expected.

    Here is a codepen of how it should work (using https://cdnjs.cloudflare.com/ajax/libs/gsap/latest/TweenMax.min.js)

    See the Pen pooXMNQ by hugoartemisrune (@hugoartemisrune) on CodePen



    And here is the identical code that doesn't work (https://cdnjs.cloudflare.com/ajax/libs/gsap/3.0.1/gsap.min.js)



    Can anyone shed any light on this matter? I'm mid port to gsap 3 and wasn't quite expecting this behavior :)

    Thanks, 

    Hugo

    for reference, the code in both examples is
     

    var Cont={val:0} , NewVal = 250000 ;
    
    TweenLite.to(Cont,1,{val:NewVal,roundProps:"val",onUpdate:function(){
      document.getElementById("counter").innerHTML=Cont.val
    }});

     

    See the Pen MWWMNJL by hugoartemisrune (@hugoartemisrune) on CodePen

×
×
  • Create New...