<script type="text/javascript">
var dragElement; //declare global variable
$("#dropContainer").ejDroppable({
over: function (args) {
if (dragElement[0].id = "drag") { //check the element through global variable
alert(dragElement[0].id + " element is moved over the drop container")
}
}
});
function onCreate(args) {
$('#drag').ejDraggable({
clone: true,
dragArea: ".frame",
dragStart: "ondragstart"
});
}
function ondragstart(args) {
dragElement = args.element; //update the variable during dragStart of all drag elements.
}
</script> |