Jump to content


Draggable image jumps to left margin when touched

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



Here again with a weird issue: When making an image draggable (using "type" as top,left) it jumps to the left viewport margin out of the mouse or finger touch. Then, if touched again, it remains under the mouse or finger with no problems.


That behavior wasn´t present when using type x,y. Changed to top,left to better handle the end X or Y points when ending the drag event.


Any clue about this weird behavior?


Your help will be appreciated.

Link to comment
Share on other sites

Please create a simple demo for us to investigate. Very hard to diagnos without seeing all the HTML, CSS and JavaScript.

Link to comment
Share on other sites

Yep, I understand that, I mean, there's no other way of figuring out that.


However program is very complex right now and would be very time consuming to "assemble" a special test case that in the end may up solving the issue by not including every involved variable.


In this case, I'm going to try to solve it. In fact experimenting a little, changed the container and now, image jumped out of the viewport. This is clearly showing the issue has to do with the container. Since I'm using an UI framework, let me try by defining a new container and see what happens.


I'll post the results here to help others that may face the same problem.


Thank you!

  • Like 1
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.