Jump to content
Search Community

erikb last won the day on January 10 2016

erikb had the most liked content!

erikb

Members
  • Posts

    173
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by erikb

  1. Bassta -- not to worry, that is the solution I've already implemented.  I was hoping there was something like the SteppedEase where you could pass another ease in as a parameter.
  2. Thanks Bassta

     

    This is what I was looking for, but seems to be missing a feature --  it is only linear.  How would I use one of the other eases?

  3. How would I use greensock js to animate an effect like the one described herein:

     

    http://stackoverflow.com/questions/1736922/how-to-show-animated-image-from-png-image-using-javascript-like-gmail

     

    My best guess is to tween the value between 0 to 1 of a vanilla javascript object, and onUpdate to do the math to change the css background position to the closest "step".  This way I could use any of the easing functions too.

     

    But I am wondering if there is a better way?

     

  4. In this simple example

     

    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html lang="en">
    <head>
    <script src="TweenLite.min.js"></script>
    </head>
    
    <body>
    sup?
    </body>
    </html>
    

    the chrome debugger timeline shows that RequestAnimationFrames are firing all the time, and, as you can see, there is nothing much going on.

     

    I would like to only enable the RaF calls when an animation is actually running. How would I do that? It is okay for me to do this manually. Thank you.

     

    And, somewhat related, for not-tween-related work in my site, I am using my own RaF shim. I am wondering if there is a nice way to plug into the RaF shim in the tweening engine (so as to reduce code redundancy)?

  5. Yes, if I bundled all of my tweens together, then they would all be killed. Good point.

     

    However, if I don't design my tweens this way, and only used one tween to move my scrollbar, then I am left with a running tween in the background.

     

    For situations like this, I think I will use the aforementioned proxy object. Thank you, this has been an informative exchange.

  6. Good idea putting the logic into the setRatio function. However, this does not kill the tween, right? ( myTween._active returns true until the full duration of the tween is completed ).

     

    Would it be good practice to kill the tween if skipX or skipY is true in the setRatio function?

  7. I have, for now, opted to update a proxy javascript object, check its tweened value against the scrollable div's current value, and decide to either apply the new tweened value via css or to cancel the animation.

  8. Got it, thanks. A related question about my aforementioned example:

     

    If the window scrollbar is tweening and the user grabs the scrollbar, I want to stop the tween.

     

    I was planning to accomplish this by noting the scrollTop position of the scrollable div before the animation, and during the animation update this value in the onUpdate callback. Also in the onUpdate callback, I was planning on checking if scrollTop was a different value than it was last step of the tween, indicating something else had moved the scrollbar.

     

    However, since onUpdate is called after the new value is set, I am not sure where to make this check to stop the tween. Is there a way to get a callback before the new value is updated, or to get the previous value in onUpdate? Or maybe there is a different way to solve this problem.

     

    Thank you.

  9. I am wondering if you can provide an architectural overview of your animation engine's inner workings.

     

    The performance is outstanding, and the code is easy to read, but could you provide an overview of what the library is doing to achieve such gains?

     

    A comparison with jQuery's animate function would be super. (but as that is not your project, someone on that team might better field that request).

×
×
  • Create New...