Drag me around
<div id="draggable" class='drg_box'>
<p>Drag me around</p>
</div>
<br><br>
<button id=b1 class=my_button>Disabled : True</button> <button id=b2 class=my_button>Disabled : False</button>
<br><br>
<div id=d1></div>
<script>
$(document).ready(function() {
////////////////
$( "#draggable" ).draggable({
disabled:true
});
//////
//////
$("#b1").click(function(){
$( ".drg_box" ).draggable( "option", "disabled", true );
var disabled = $( ".drg_box" ).draggable( "option", "disabled" );
$('#d1').html("disabled : " + disabled);
})
///////////
//////
$("#b2").click(function(){
$( ".drg_box" ).draggable( "option", "disabled", false );
var disabled = $( ".drg_box" ).draggable( "option", "disabled" );
$('#d1').html("disabled : " + disabled);
})
///////////
var disabled = $( ".drg_box" ).draggable( "option", "disabled" );
$('#d1').html("disabled : " + disabled);
///////////
})
</script>