jquery - know the element you are over while dragging -
i faced problem identical thread:
jquery droppable - receiving events during drag on (not on initial drag over)
the difference need know element i'm on , it's not "droppable" element. it's element inside droppable.
so if have parent div (that droppable) has 3 child divs, while i'm dragging item on 3 child divs, want know if, when dropped, item should dropped above or below 1 of child elements.
the same problem exists in post above (mouseover, etc., events not firing on child elements of droppable div).
thoughts?
you mouse x & y coordinates or offset x & y of item when dropped - plus it's height & width etc. calculate boundaries of object , accurate drop position.
$(this).offset().top / $(this).offset().left $(document).mousemove(function(event) { currentmousepos.x = event..pagex; currentmousepos.y = event.pagey; });
then iterate on objects sit below , compare coordinates / boundaries object ones. can have logic works out if more above below etc. if it's not straightforward call.
Comments
Post a Comment