In your Droppable.add, attach an onDrop callback
See http://wiki.script.aculo.us/scriptaculous/show/Droppables.add

After a quick check of drogdrop.js, it appears the callback has the form:
myCallback( draggableElement, droppableElement, event)

From there, you'll likely need to use Event.pointerX(event) and Event.pointerY(event), along with Position.within() for each div in your droppable. (all in the Prototype library)

Cheers,


TAG

On Jun 14, 2006, at 10:09 AM, Hugo Magalhaes wrote:

Hello Tom,
thanks for your help. I've added the attribute to the element itself.
But now I have another problem:

I want to drag some div elements to a droppable (another div), but the
place I want to place the draggable depends on where the mouse is. If
the mouse is between two div elements inside the droppable, the
draggable should be placed between the two divs. How can I do this?

Thanks for you help,
H

On 14/06/06, Tom Gregory <[EMAIL PROTECTED]> wrote:
Instead of extending the draggable, how 'bout simply adding an
attribute to the element itself, or using the element's className?


TAG

On Jun 14, 2006, at 1:49 AM, Hugo Magalhaes wrote:

> Hello all,
> I want to extend a draggable object so it has one more attribute (type
> attribute, so I can distinguish different draggable types).
> Can anyone tell me how to do it?
> I've search throught the examples (like
> http://wiki.script.aculo.us/scriptaculous/show/ExtendClass) but I
> can't seem to understand what I should do.
>
> Thanks for you help,
> H
> _______________________________________________
> Rails-spinoffs mailing list
> Rails-spinoffs@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to