get div id when an object is dropped using jquery -


i want div id of dragged item when dropped div. problem , when drop layer 3, reads layer 1 , layer 2. want layer 3 since hovered.

please consider code below.

thanks in advance.

<div>  <img class="item" src="img.jpg"/> </div> <div id="layer1" class="droppable" style="width:100px; height : 100px ;">  <div id="layer2" class="droppable" style="width:70px; height : 70px; ">   <div id="layer3" class="droppable" style="width:50px; height: 50px">            drop image here    </div>   </div> </div>     <script> $(function(){  $(".droppable").droppable({ accept : 'item' , drop : calldropp });      function calldropp (){     <!-- here -->   }  }) </script> 

try using event.stoppropagation:

$(function(){     $(".droppable").droppable({ accept : 'item' , drop : calldropp });         function calldropp (event){         event.stoppropagation();     } }); 

this should stop dropping propagation @ inner element.


Comments

Popular posts from this blog

c++ - Linked List error when inserting for the last time -

java - activate/deactivate sonar maven plugin by profile? -

java - What is the difference between String. and String.this. ? -