Capturing the position of a draggable element

I would like to capture the position of a draggable element after it’s
being dragged, but I am running into problem using several options, such
as “change”, “revert” and “onEnd”. My callback handler would only fire
when the page loads, and not when the element is dragged. How can I make
this happen?


2006/1/13, jeannie lu [email protected]:

What that does, is assign the return value of “alert(this)” (probably
false or something) to options.onEnd. A simple way to do what you want
would be:

but a more powerful solution would be to create your own object to
handle the dragging, which would look something like this:

var MyDraggable = Class.create();
MyDraggable.prototype = {

initialize: function (element, options) {
  // drag and drop
  new Draggable(element, options);

onEnd: function () {

// your code here




This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs