jQuery drag and drop behavior with partially transparent image

Posted by Aaron on Stack Overflow See other posts from Stack Overflow or by Aaron
Published on 2010-04-21T21:46:02Z Indexed on 2010/04/21 21:53 UTC
Read the original article Hit count: 244

Filed under:
|
|

I'm trying to develop a drag-and-drop behavior based on the jQuery UI draggable behavior but am running into some road blocks. I want to be able to drag several images with transparent regions around a region of the screen. I want the user to be able to drag the image he clicks and not just whatever draggable div or PNG happens to be z-indexed on top.

The below image is a screen grab from my test page. If I click the lower left region of the blue square through the red thing I should drag the square and not the red thing. The red thing is what gets dragged though because it is on top and the browser does not care about the transparency. My question is, how can I make it behave as expected in this situation and drag the square instead?

Edit: Seems I can't attach images as a new user. See this URL for my example image: http://i42.tinypic.com/r1g4sk.png

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about jquery-ui