Pata Posted February 28, 2022 Share Posted February 28, 2022 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 More sharing options...
OSUblake Posted February 28, 2022 Share Posted February 28, 2022 Hi Pata, You can hit test any 2 elements you want using the static version of the Method. Draggable.hitTest("#foo", "#bar") 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now