# Getting coordinates from draggable\_element

**URL:** <https://www.ruby-forum.com/t/getting-coordinates-from-draggable-element/124998>\
**Category:** Rails\
**Created:** [January 4, 2008, 2:06pm UTC](https://www.ruby-forum.com/t/getting-coordinates-from-draggable-element/124998 "2008-01-04T14:06:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gorter9](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/839c29/32.png) [@gorter9](https://www.ruby-forum.com/u/gorter9)\
**Post date:** [January 4, 2008, 2:06pm UTC](https://www.ruby-forum.com/t/getting-coordinates-from-draggable-element/124998/1 "2008-01-04T14:06:05Z")

</div>

I tried to get the coordinates of a draggable\_element.

I found in this topic a way to get the coordinates but i don’t know what  
i must set in the action reposition

at the moment i only have this

Verplaats de afbeelding naar de gewenste plaats
\<%= draggable\_element :dragDIV, :snap =\> 10, :ghosting =\> true %\>

\<%= drop\_receiving\_element(“dragDIV”,  
:url =\> { :action =\> “reposition” },  
:loading =\> visual\_effect(:highlight),  
:update =\> ‘admin\_status\_message’,  
:with =\> "‘id=’ + encodeURIComponent(element.id)

- ‘&x=’ + encodeURIComponent(Element.getStyle(element,‘left’))
- ‘&y=’ + encodeURIComponent(Element.getStyle(element,‘top’))
- ‘&w=’ + encodeURIComponent(Element.getStyle(element,‘width’))
- ‘&h=’ + encodeURIComponent(Element.getStyle(element,‘height’))") %\>
