Jump to content
Search Community

iamryandnelson

Members
  • Posts

    4
  • Joined

  • Last visited

Posts posted by iamryandnelson

  1. This is really helpful, thank you.

     

    I applied the map function you recommended, but in my case I'm dragging to the left, so I set the maxX to -565, which seems to throw off the maxDuration time. When I set maxDuration to 10 I get less than 1 second of animation; setting it to 100 gets me about 2 seconds. I could hack it, but would prefer not to...do you see what I'm doing wrong?

     

    Here's my Codepen again: 

    See the Pen dRbKMM?editors=0010 by iamryandnelson (@iamryandnelson) on CodePen

     

  2. 3 hours ago, Carl said:

    Hi and welcome to the GreenSock forums,

     

    Thanks for providing the demo. To get the element to animate back to it's start value try this for your onDragEnd callback:

     

    
    onDragEnd: function() {
          TweenLite.to(this.target, 1, {x:0}) //or whatever value the start value is
        }

     

    Thank for the quick reply Carl :). This solution gets the animation working (I was writing TweenMax not TweenLite :P), but it doesn't sync with the timescale. If I update the time in your solution from 1 to 10, no matter how far I drag the image it will take 10 seconds to finish animating (setting it to 10 actually gets me 14 seconds). How can I set it up so that the whole draggable area is set to 25 minutes and dragging to a corresponding time on the timescale will produce an accurate timer for that time (e.g. dragging to the 5 minute mark will result in a 5 minute animation)?

×
×
  • Create New...