Provides drag'n'drop functionality.
Creates a GhostDrag object.
Marks element as draggable. When user drags it, a
"ghost" clone is created. Then, the process function
is called with this clone as argument. If user drags the clone
to one of marked target zones, a callback is performed
with three arguments - x , y and target
element .
Marks element as not draggable.
Removes all draggable elements from this GhostDrag object.
Marks element as a valid ending zone for
drag'n'drop.
Marks element as not a target zone.
Removes all target zones from this GhostDrag object.
var product = Dom.create("img"); var shopping_cart = Dom.create("div"); var gd = new OAT.GhostDrag(); var dummyReference = function() {}; var successReference = function(target, x, y) { alert("Success!"); } gd.addTarget(shopping_cart); gr.addSource(product, dummyReference, successReference);