Jump to content
GreenSock

MSCAU

Members
  • Posts

    13
  • Joined

  • Last visited

Posts posted by MSCAU

  1. Thanks, @Dipscom, that doesn't sound right. The function $('.floater').click(function(e) {...} runs before every animation and already sets the fixed_offset_top value. Having that value change triggered by a window resize event rather than a click doesn't sound likely to make any difference.

     

    And as you can see here, it doesn't: 

    See the Pen zJqPxN by MSCAU (@MSCAU) on CodePen

     
    Maybe I'm not understanding what you mean by "recreate your timelines".

     

  2. I have a toolbar which can be either at the top or the bottom of the window (position: fixed). I use tlup and tldown tweens to transition between the two positions. I want this to continue working smoothly when the user resizes the browser (eg. by rotating their mobile device - hence the fixTop and fixBottom callbacks). Despite the fact I'm recalculating the pixel distance between the top and bottom of the screen before each pass (via the fixed_offset_top variable), once the window is rotated, it seems as though my animation is preserving some 'memory' of its previous tween target as it doesn't end up in the right place.

     

    I've read this topic and applied clearProps:"transform" to some effect, but it's obviously not a complete solution to my problem:

     

    See the Pen aaNvGY by MSCAU (@MSCAU) on CodePen

  3. (I am trying to use two separate timelines for open and close animations. I have two tests set up which have the same error.)

     

    I pass references to timelines to my callback functions. When I pass them as timeline instances, the callback function reports that they are undefined. I can work around it by passing the names of the timelines as strings but that is clumsy. What am I missing? You'll need to have the console open to see the errors. They also manifest themselves after a few toggle actions as timelines don't get reset properly.

     

    See the Pen OoModO by MSCAU (@MSCAU) on CodePen

     

    See the Pen OoModO by MSCAU (@MSCAU) on CodePen

  4. For (my own) future reference, here's what works, showing that a circle's radius needs to be tweened within the attr property but stroke-width, stroke-opacity and fill-opacity (for example) don't:

     

    <circle cx="75" cy="130" r="0" id="wave"/>
      
    var tl = new TimelineMax({repeat:-1});
    tl.to("#wave", 1, {attr:{r:100}, 'stroke-opacity': 0, 'stroke-width': 5, 'fill-opacity': 0});

     

×