Jump to content


Tween a Draggable element

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hi all, been struggling with this for a long time now.


Is there a way to tween a draggable, more specifically a type:"scrollLeft" element's position by clicking a button?


Think of a draggable, scrolling left and right carousel - with a button.

When the button is clicked the draggable element slides to the right 300px.


I know there are methods to enable and disable the dragging, but I don't see a way to target the actual moving element. Even to manually go in and target the draggable item with a tween might work... but I can't seem to even find what moves!


Thanks for any help you can offer!


Link to comment
Share on other sites

Ok, sorry!


I think I may have figured it out. I was trying to tween a property like 'x' and should have been looking at tweening 'scrollLeft'.


Hope this helps someone!

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.