Jump to content
Search Community

dave1

Members
  • Posts

    11
  • Joined

  • Last visited

Posts posted by dave1

  1. Thanks for the quick reply.

     

    I'm using John Polacek's Superscrollarama plugin which calls reverse() internally, so I have to rely on events being triggered by GSAP. I suppose I could also hack Superscrollarama and trigger an event where the reverse() method is invoked.

  2. Hi Greensock,

     

    This time I've come prepared with a test case: http://jsfiddle.net/ntDdq/25/

     

    Steps to reproduce:

     

    1 - in Results pane, scroll all the way down the page, you should see a circle animate from 0 scale to 0.5, to 3 and back to 0.

     

    2- At the bottom of the page, scroll all the way back up.

     

    Expected results: Tween should animate in reverse without error.

     

    Actual results: Tween jumps to incorrect x/y positions, possibly a transform is wrongly written.

     

    I've dug into the Raphael plugin code and found that commenting out Line 89 ( t._gsTransform = m; ) in _getTransform() prevents the x/y position from jumping in reverse. Unsure where the exact problem originates from.

     

    Any ideas?

  3. I'm manually tweening the progress using the scroll event. It would animate if your page was long enough that you could scroll the page.

     

    What I mean when it jumps: if you were to scroll the page so the animation runs completely and begin scrolling back up the page in reverse, eventually the tween will reach a point where the animated objects behave oddly, jump to incorrect places etc.

     

    It may be a bad example, but seems to illustrate the exact same problem I'm having with Superscrollarama.

  4. If someone can figure out what's going wrong you'll make me very happy.

     

    I've had this issue with and without using Superscrollarama so I'm now thinking my issue is with the Raphael plugin. Basically I'm drawing shapes using Paper.path() and mostly just scaling the paths up and down. When I reverse the animation the animation jumps/breaks.

     

    Here's a bare bones example without Superscrollarama:

     

     // adding paper.path()'s excluded
    
     var tl = new TimelineLite({useFrames: true});
     tl.pause();
    
     var tl1 = new TimelineLite();
     var t1 = [];
    
     paper.forEach(function(path){
    t1.push(TweenLite.to(path, 1, { raphael: { scaleX: '+=3', scaleY: '+=3'}}));
     });
     tl1.append(t1);
    
     var tl2 = new TimelineLite();
     var t2 = [];
    
     paper.forEach(function(path){
    t2.push(TweenLite.to(path, 1, { raphael: { scaleX: '-=3', scaleY: '-=3'}}));
     });
     tl2.append(t2);
    
     tl.append(tl1);
     tl.append(tl2);
    
     $(window).on('scroll', function(){
    var pct = $(this).scrollTop() / ($(document).height() - $(window).height());
    tl.progress(pct);
     });
    

  5. Thanks for the tip, so far I'm using the window scroll event to calculate the percent like so:

    var pct = $(this).scrollTop() / ($(document).height() - $(window).height());
    

     

    Then I apply the percent to the timeline progress method

    tl.progress(pct);
    

     

    Is this the best way or is there a more optimized method?

×
×
  • Create New...