Skip to content Skip to sidebar Skip to footer

How Can I Set Child Element As Droppable To False

I have a div element which is droppable. And it has a(link) elements and span elements. I drag an element to div its work perfectly but when i drag over to a element and drop it th

Solution 1:

You can attach a new method for child element to not allow dropping on that child . And inside that method call stopPropagation.

 <div class="shortcuts" id="drop1" ondrop="drop(event)" ondragover="allowDrop(event)">
       <a href="javascript:;" class="shortcut" ondragover="noAllowDrop(event)><i class="shortcut-icon icon-list-alt"></i><span class="shortcut-label">Apps</span> </a>

    </div>




function noAllowDrop(ev) {
        ev.stopPropagation();
    }

Post a Comment for "How Can I Set Child Element As Droppable To False"