I want to reset some draggable objects to its original position by clicking a button. i can move and find current position. But how to reset them by clicking "Reset" button? It is all inside a container. Can anyone help me?
Check this FIDDLE
var coordinates = function(element) {
element = $(element);
var top = element.position().top;
var left = element.position().left;
$('#results').text('X: ' + left + ' ' + ' Y: ' + top);
}
$('#custombox').draggable({ containment: "#containment-wrapper", scroll: false,
start: function() {
coordinates('#custombox');
},
stop: function() {
coordinates('#custombox');
}
});
$('#logo').draggable({ containment: "#containment-wrapper", scroll: false,
start: function() {
coordinates('#logo');
},
stop: function() {
coordinates('#logo');
}
});
$("#logo").resizable({ containment: "#containment-wrapper", scroll: false,maxHeight: 250, maxWidth: 350, minHeight: 50, minWidth: 50 });