Jump to content
Search Community

GSAP timeline breaking in conjunction with Draggable plugin

Moritz L test
Moderator Tag

Go to solution Solved by Rodrigo,

Recommended Posts

Hi! I am working on scrubbable video controls. I recreated the most simple version of the controls (without video and animated time) in a CodePen.

I've also read this entry in the forums. But even though the problem is the same, the solution didn't seem to apply to my problem – or I am just not seeing it. 

 

The problem: My player works just fine when you click on "play", then "pause" and then drag the playhead around. When you then click "play" again, the playhead starts animating from the respective position as intended. BUT: When you hit "play" and drag the playhead without hitting "pause" first, the timeline animation doesn't work anymore. To be precise: The playhead won't animate anymore (until you rerun the code), yet the track fill will resume animating.

 

Play around with the CodePen and you'll see what I mean.

 

My best guess: It has something to do with the inline styles that are applied by GSAP. Because, when I am changing Draggable.type to "left", the animation is resuming also when not hitting "pause" before starting to drag. But then the dimensions seem to off and the playhead doesn't move in sync with the track anymore. And I haven't found a solution for that problem either. 

 

I really appreciate any pointing in the right direction. 

 

Thanks!

See the Pen YzRewPL by moritzlaube (@moritzlaube) on CodePen

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...