<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>
Hover over the droppable element to apply class, change the selection below.
<div id=d1></div>
<br>
<div class='radio-inline'>
<label><input type='radio' name='r1' id='r1' value=' highlight' > highlight</label>
</div>
<div class='radio-inline'>
<label><input type='radio' name='r1' id='r2' value='ui-state-highlight' checked>ui-state-highlight</label>
</div>
<div class='radio-inline'>
<label><input type='radio' name='r1' id='r2' value='ui-state-error' >ui-state-error</label>
</div>
<div class='radio-inline'>
<label><input type='radio' name='r1' id='r2' value='ui-state-error-text' >ui-state-error-text</label>
</div>
<div class='radio-inline'>
<label><input type='radio' name='r1' id='r2' value='ui-state-disabled' >ui-state-disabled</label>
</div>
<div class='radio-inline'>
<label><input type='radio' name='r1' id='r2' value='ui-priority-primary' >ui-priority-primary</label>
</div>
<div class='radio-inline'>
<label><input type='radio' name='r1' id='r2' value='ui-state-disabled' >ui-priority-secondary</label>
</div>
<script>
$(document).ready(function() {
////////////////
$( function() {
$( "#draggable" ).draggable({
refreshPositions: true
});
});
///////////
$( "#droppable" ).droppable({
classes: {
"ui-droppable": "highlight",
"ui-droppable-hover": "ui-state-highlight"
},
drop: function( event, ui ) {
$( this )
.find( "p" )
.html( "Welcome Dropped!" );
}
});
///////////////
var class_used = $( "#droppable" ).droppable( "option", "classes.ui-droppable-hover" );
$('#d1').html( " <b>Classes Used for : classes.ui-droppable-hover </b> " + class_used );
///////////
$("input:radio[name=r1]").click(function() {
var sel=$(this).val()
$( "#droppable" ).droppable( "option", "classes.ui-droppable-hover", sel );
var class_used = $( "#droppable" ).droppable( "option", "classes.ui-droppable-hover" );
$('#d1').html( " <b>Classes Used for : classes.ui-droppable-hover </b>: " + class_used );
})
///////////////////////
})</script>