Jump to content
Search Community

Change DOM structure of draggable element while dragging cause element jump

sumimasenga test
Moderator Tag

Go to solution Solved by Diaco,

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!

 

Im building a thing where I drag a element and check with hitTest for another element. I need to change the DOM structure so the dragger element gets inside ".drop-here" element as soon the hitTest is true. It works fine but the draggable elements gets jumpy when dragging to the ".drop-here" area.

 

I need to reset/update the coordinates I guess but dont now how. I tried using draggable.update() with no success. Any suggestion to solve this problem?

 

Many thanks!

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

Link to comment
Share on other sites

  • 1 year later...

Hello Joelcox, and welcome to the GreenSock Forum!

 

Yeah this could be a new topic, but try this using on your main section elements

 

See the Pen mAyyQP by joelcoxokc (@joelcoxokc) on CodePen

.container {
  overflow-y:auto;
  overflow-x:hidden;
}

That is one way to do it when the items in the container extend past the height of the combined list-items.

 

Does that help? :)

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...