Jump to content

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


  • Posts

  • Joined

  • Last visited

staff0rd's Achievements


Newbie (1/14)



  1. Just in case someone lands here from google (like I did), I'll answer this question. The reason this is occurring for ADVANCED_OPTIMIZATIONS only is because that mode makes heavy modifications of the source, including renaming of functions and properties that it sees inside your code. This means unless you declare GSAP as an external source, its going to go ahead and rename all those easings to whatever it pleases. You can see more info on the various ways of insuring this doesn't happen in the docs. A quick fix that I use for individual use cases, rather than entire libraries, is to declare empty objects with the relevant property names and pass those into the compiler as externs, for example; var Linear = { ease: {}, easeIn: {}, easeInOut: {}, easeNone: {}, easeOut: {}, }; This insures that ADVANCED_OPTIMIZATIONS does not rename those properties in my code base.
  2. Thanks for your response Jonathan - alpha was just an example, in this scenario I am not tweening CSS. I'll include a pen at a later date if I i'm able to isolate my findings. For now I'm happy to know shouldn't need the onComplete for that purpose.
  3. In my experiments with TweenLite/TweenMax I believe in some occasions I am able to reach a scenario where the final value of a .to() setting was not reached due to the performance available on the device running the tween. This is difficult to repro due to (I think) the occurence of this being based on the amount of CPU available at any one time during the tween. What I think is happening (purely speculation, I have checked docs but not source), is that TweenLite/TweenMax will attempt smooth tweens where it can, however when performance is being limited either by the device or too much other stuff going on, the library will essentially "skip" values to ensure the tween stays in sync with the start/end. If this is happening, my question is, is it possible for this "skipping" to occur on the final value? For example, do I need to do something like this to ensure I always reach the final value, regardless of the performance of the device? TweenLite.to(myObject, 1, { alpha: 1, onComplete: function() { myObject.alpha = 1; } }); Anecdotally I have seen the completion of a tween where an object was still somewhat transparent, so I'm wondering whether I need to include the onComplete above, or, whether TweenLite/TweenMax is already addressing this and whether my observations were related to something else.