Jump to content
Search Community

Frederic Gontier

Members
  • Posts

    16
  • Joined

  • Last visited

Posts posted by Frederic Gontier

  1. Hello,

    This question is for a banner ad.

    Is it possible to stop completely the ticker after an animation is done playing in order to save CPU usage?

    Is there a gsap.ticker.remove(myFunction) ?

    Should I use:  gsap.ticker.fps(0)  ?

    ... or there is another way to do that?

     

    Thank you,

    fred

  2. Hello,

    I would like to set elements from an array to random x and y, move them to a new random x and y position and finally have them go back to their recorded first x and y position. The following doesn't work because there is a jump between the last two tweens:

     

    var myArray = [{x:10,y:10},{x:10,y:55},{x:10,y:100}];

    var tl = gsap.timeline()
        tl.set(myArray,{x:"random(20,280)", y:"random(20,230)"})
        tl.to(myArray,{x:"random(20,280)", y:"random(20,230)", duration:5})
        tl.from(myArray,{x:"random(20,280)", y:"random(20,230)", duration:3})

     

    How can I do that? Is there a better approach?

    Thank you,

    fred

    See the Pen VwvPrqQ?editors=1010 by fr3d3ric (@fr3d3ric) on CodePen

  3. Hello,

    I am playing with the Function-based values and I don't understand the following:

    If scale is before x, everything works fine, the boxes are scaled proportionally:

     

    TweenLite.to(".box", 1, {
      scale: function() {
        return Math.random();
      },
      x: function() {
        return Math.random() * 300;
      }
    });
     
    But if x is first, the boxes are not scaled correctly:
    TweenLite.to(".box", 1, {
      x: function() {
        return Math.random() * 300;
      },
      scale: function() {
        return Math.random();
      }  
    });

    Thanks,

    fred

    See the Pen qqLaZP by fr3d3ric (@fr3d3ric) on CodePen

×
×
  • Create New...