Demo of activate and deactivate events of droppable element

Drag me to my destination

Dropp here

Drag ( activate event) and stop ( deactivate event ) in-between to see the events.




HTML

<div class='row'> <div class='col-md-6'> 
<div id="draggable" class="ui-widget-content">
  <p>Drag me to my destination</p>
</div>
</div><div class='col-md-2'>  
<div id="droppable" class="ui-widget-header" >
  <p>Dropp here</p>
</div>
</div></div>

jquery

<script>
$(document).ready(function() {
////////////////
$( function() {
$( "#draggable" ).draggable({
});
});
///////////
$( "#droppable" ).droppable({
activate: function( event, ui ) {
      $( this )
        .find( "p" )
        .html( "started moving " );
     },
 deactivate: function( event, ui ) {
      $( this )
        .find( "p" )
        .html( "stopped  " );
     }
    });
///////////////
///////////////////////
})
</script>