Jump to content
Search Community

Multiple draggable items disable 1, all are disabled

Oscar Rottink 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

I think I'm doing something very wrong. Got a large container which is draggable and one inside that container which is draggable. If I drag the small one the other one shouldn't be dragged anymore. 

 

If I try to disable the outer one (probably wrong) all drag is disabled (well almost).

 

Created a little codepen here which displays the problem: 

 

Edit: I think I got it while playing around. Would be nice if someone told me this is the way to do this :)

See the Pen Lrqvk by OzBoz (@OzBoz) on CodePen

Link to comment
Share on other sites

Hi,

 

Thanks a lot for creating the test case for us.

 

I just looked at your pen. Not sure if it is in the fixed state or not.

Is it now behaving the way you want? From my first look at your code it seems to be doing what you are telling it to do.

 

If this is working for you, I really don't see anything wrong with what you are doing (again, not exactly sure what you want).

 

If you need more help, please provide detailed steps explaining what I can do to see the unwanted behavior.

 

Thanks.

  • Like 1
Link to comment
Share on other sites

Hi!

 

Yeah Carl that was the behaviour I wanted. But I see has an even shorter version. Not sure if you believe me Diaco but I actually did played with the stopPropagation() thing before I posted. I really need to get some more basic knowledge of javascript so it's less try and error but more logical :)

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