With your droppable:
Droppables.add('thingy',{accept:'something',onDrop:function
(dragName,dropName){findMe(dragName,dropName)}})
function findMe(dragName,dropName) {
myPos = findPos($(dropName))
alert(myPos[0]+", "+myPos[1])
}
function findPos(obj) {
//I like this Quirksmode function to find positions:
var curleft = curtop = 0;
if (obj.offsetParent) {
curleft = obj.offsetLeft
curtop = obj.offsetTop
while (obj = obj.offsetParent) {
curleft += obj.offsetLeft
curtop += obj.offsetTop
}
}
return [curleft,curtop];
}
On Jan 19, 6:31 pm, "antonio.grazi...@gmail.com"
wrote:
> Hi Everybody, new here
>
> I am building an interface for a web app using scriptaculous.
> I made a 4x4 grid with some boxes (DIVs) which are draggable and they
> all work great...
> My probelm: I need to "read" object position when they are dropped and
> reach their final position...(and write them in some hidden input
> boxes, for example)...
> I am trying with some Javascript in the dragdrop.js ...but no luck so
> far
> How can I achieve this behaviour?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---