M
MarkusJNZ
Hi all, I have a page which allows a user to drag and drop one or more
images on a page.
I have a function which is passed in a reference to the item being
dragged so I can do things like;
Pseudo code below:
function Drop(obj)
{
alert(document.GetByElementId(obj).style.posLeft);
}
The above seems to give the offset x coordinate from the objects
original position.
Likewise I have tried
alert(document.GetByElementId(obj).style.Left); Which gives the same
value
I have also tried capturing the x and y coordinate of the mouse when
the person releases the mouse button. The problem is that if the person
drags the image in the middle then it does not give the correct top
left of the image.
So, can anyone please tell me how I can get the top left coordinates of
the item being dragged when a person releases the mouse button?
TIA
Markus
==================================
googlenews2006markusj
images on a page.
I have a function which is passed in a reference to the item being
dragged so I can do things like;
Pseudo code below:
function Drop(obj)
{
alert(document.GetByElementId(obj).style.posLeft);
}
The above seems to give the offset x coordinate from the objects
original position.
Likewise I have tried
alert(document.GetByElementId(obj).style.Left); Which gives the same
value
I have also tried capturing the x and y coordinate of the mouse when
the person releases the mouse button. The problem is that if the person
drags the image in the middle then it does not give the correct top
left of the image.
So, can anyone please tell me how I can get the top left coordinates of
the item being dragged when a person releases the mouse button?
TIA
Markus
==================================
googlenews2006markusj