| Overview | Index | GodLikeMouse JavaScript Framework |
| FRAMES | NO FRAMES |
GLM.DOM.DragAndDrop
Class for handling drag and drop interaction. The class by default looks for the "handle" attribute on the element to be dragged. Once found it will look through the parent including the initial mouse down element to find the "drag" attribute. It will then move the element where the "drag" attribute is specified.
Example:
var dnd = new DragAndDrop();
function OnBeginDrag(source){
alert("source element is: " + source.tagName);
}//end OnBeginDrag()
function OnDrag(source, dest){
if(dest)
alert("drop target: " + dest.tagName);
}//end OnDrag()
function OnDrop(source, dest){
alert("source is: " + source.tagName);
alert("dest is: " + dest.tagName);
}//end OnDrop()
dnd.setBeginDragCallback(OnBeginDrag);
dnd.setDragCallback(OnDrag);
dnd.setDropCallback(OnDrop);
| Overview | Index | GodLikeMouse JavaScript Framework |
| FRAMES | NO FRAMES |