draggable_element. . is there a way?

Is there a way to hook into a draggable_element so that I could update the location of the element in my rails code? So say I had a draggable called "frame", when I stop dragging, I want to do something that would be the equiv of session[:frame][:loc] = (current location of frame).

There's a change callback on the draggable_element it looks like, but not quite sure how to get from there to here.

Any help appreciated.

H

I seem to be fairly close. However, there is still one hangup I would like to see if anybody has an answer for. I've discovered the :with => option for the remote functions. So now I have this defined in my element's div tag:

<div   id = "<%= frame.id %>_title"   class = "<%= frame.html_set%>_title"   style="     border: solid blue 1px;     position: absolute;     left: 0px;     top: 0px;     width: 100%;     height: 25px;"   onmouseup="<%= remote_function :url => { :controller => "test", :action => "doit", :with => 'document.getElementById("left_top_frame").offsetTop'} %>">

The goal here is to store the offsetTop, at least, in the request so I can get it back out in my controller. However, I'm stuck trying to figure out a way to escape everything, I've tried everything I can think of. Here's what the browser is getting:

  <div   id = "left_top_title"   class = "basic_title"   style="     border: solid blue 1px;     position: absolute;     left: 0px;     top: 0px;     width: 100%;     height: 25px;"   onmouseup="new Ajax.Request('/test/doit?with=document.getElementById%28left_top_frame%29.offsetTop', {asynchronous:true, evalScripts:true})">

Anybody have any idea how I could escape that? Or is there a better way to go about this?

Thanks!

H