Jump to content
Search Community

Draggable ghost element

beamish test
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,

 

I'm using GSAP's Draggable, and I noticed that while the users starts dragging, a hidden ghost div is appended to the div which contains the dragging element.

This is what is looks like:

<div style="visibility: hidden; height: 1px; top: -1px; pointer-events: none; position: relative; clear: both; width: 585px;"></div>

Is this necassary? Can I eliminate this div OR eliminate it's width (because it widens the container div incorrectly) ?

 

Thanks,

 

Elior

Link to comment
Share on other sites

That should actually only be implemented if you enable autoScroll, but there was a regression in a recent version that could cause it to show up in other situations. Sorry about that. It is indeed necessary to prop open the container when you're dragging something inside a scrollable container. It should be resolved in the upcoming release which you can preview (uncompressed) at https://s3-us-west-2.amazonaws.com/s.cdpn.io/16327/Draggable-latest-beta.js

 

Does that work better for you? It was tough for me to verify in your case because you didn't provide a codepen or jsfiddle example. If you're still having trouble, that'd be super helpful (a reduced test case codepen). 

 

Thanks!

  • Like 2
Link to comment
Share on other sites

Hi Jack,

 

Thanks for the quick reply, didn't expect on the weekend, sorry if I disturbed you.

 

I decided to avoid the 'autoScroll' option at the moment, it isn't quite necassary for me at the moment, and things seem to work well now,

 

Thanks again,

 

Elior

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