Jump to content
Search Community

Drag an element / hitTest with its child element

Pata test
Moderator Tag

Recommended Posts

Hello! I have a div element with a smaller child div element inside.


I'd like to make the parent div draggable and then run a hitTest with its child element, not the parent-dragged one.


Draggable.create("#element1", {
    type: "x,y",
    onDragEnd: function(e) {
        //see if the target overlaps with the element with ID "element2"
        if (this.hitTest("#element2")) {
            //do stuff

Following the example I want to drag the "#element1" and then make the hitTest with its child element.


Thanks in advance!

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