Detecting image id of drop target

M

Martyr2

Hi,

I am working on a drag and drop application where I can click and drag
one image and drop it onto a target image. The only way I am able to
detect the name of the target I am dropping on is if the current layer
is a lower z-index than my target (so the drop target is actually at
the forefront).

Some requirements I have is that:

1) it needs to work with Firefox/IE 5+
2) I want the image I am dragging to be on top (I am making it
transparent) until I drop onto the target.

An example of this is Googles personalized homepage where you can drag
and drop modules. This is the exact effect I am looking for. I have
exhausted almost all the sites I could find through Google. Any help
would be appreciated.
 
J

Jonas Raoni

Martyr2 said:
I am working on a drag and drop application where I can click and drag
one image and drop it onto a target image. The only way I am able to
detect the name of the target I am dropping on is if the current layer
is a lower z-index than my target (so the drop target is actually at
the forefront).

Have you tried the onmouseup event?
And you can detect the current element by using the onmousemove event ;]

If nothing works, you can detect by using any hit test function
<URL:http://jsfromhell.com/en/geral/hittest> ;]
 
M

Martyr2

Thank you. Your hit detection function worked like a charm. I had to
recode it to understand it, but I got it now. Very clever. Might want
to make it more readable in the future though.

Thanks again
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top