Jump to content


GSAP Draggable in an IFrame 'sticky' issue

Moderator Tag

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 there, 


I was wondering if there was a solution to an issue we're having where we load an HTML page containing a Draggable interaction into an IFrame.  While dragging an element, if a user moves their mouse pointer outside the bounds of the Iframe and releases, then moves their pointer back in again, the element being dragged becomes stuck to the mouse pointer and can only become unstuck with a click/release inside the IFrame.


I tried loading https://greensock.com/draggable URL into the IFrame to see if I was missing something that Greensock had implemented to get round this, but the same thing happens with the GSAP Draggable example.   


Is there some simple measure we can take to prevent this, or are we stuck with it?  


Many thanks :)


Codepen below: 


See the Pen mVjyxv by anon (@anon) on CodePen

Link to comment
Share on other sites

Add a mouseleave listener to your document, and have it call endDrag().

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