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

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -