Drag and drop objects onto a DIV.. relative vs absolute position and size of target DIV
Posted
by Scott
on Stack Overflow
See other posts from Stack Overflow
or by Scott
Published on 2010-04-22T18:04:43Z
Indexed on
2010/05/02
14:07 UTC
Read the original article
Hit count: 218
Hi, I have a question about drag and drop and hoping one of you already solved it. I have an online web app where I can drag and drop annotations (arrows, stars) on top of an image that sits on a DIV.
Here's some things to know. 1) The image can be any size (sometimes big sometimes small) 2) The DIV of wrapper can be left aligned or centered 3) The DIV of wrapper can be fixed or auto
So is there any possible solution to make it so positions of annotations are always relative to the top left corner of the image? So
I am using jQuery. How would I get an annotation's position always relative to the top left corner of an image once I drop object?
Thanks!
© Stack Overflow or respective owner