i want the draggable object to revert back to its original position when i click a button. i used \'destroy\' option but it doesnt seem to work. it disables the dragging but
Revert executes when dragging has stopped (with optional delay), not on click.
$(document).ready(function() {
var originalTop = $('#draggable').position().top;
var originalLeft = $('#draggable').position().left;
$('#Zoom').toggle(
function() {
$("#draggable").draggable({});},
function() {
$("#draggable").draggable('destroy');
$('#draggable').position().top = originalTop;
$('#draggable').position().left= originalLeft;
});
});