I have an image inside div which acts as droppable. I want to call drop function when dragging element and hover over the image. I did it but drop function is not getting called smoothly. Below is my html code
<div id="divRecycle"><img id="imgRecycle" src="Images/RecycleBin.jpg"/></div>
Below is the css used.
.recycle-hover {
padding: 10px;
border: 2px dashed orange;
}
Below is the javascript code
function MakeRecycleBinDivDroppable() {
$("#imgRecycle").droppable({
accept: ".sections,.cart-item",
hoverClass: 'recycle-hover',
helper: 'clone',
cursor: 'move',
drop: function (event, ui) {
//check if the draggable element is a section or only a product.
if ($(ui.draggable).hasClass("sections")) {
//it is a section, we will delete the section and its products
} else {
}
}
});
}