Ok, so heres some of my code on js fiddle at . The current code allows me to move the objects and it shows the stop and starting position of the object relative to its constraint. What I am needing to do, is to get the position returned of EACH object. I need them stored in separate vars. The idea is they will be able to add new shapes dynamically and those shapes will all return there coordinates and I can allow them to "SAVE" which will use all those variables and AJAX them to a database. Currently it only returns the latest dragged object, how can I modify this to allow it to show each objects position. I'm a little new to playing with JQuery/JQueryUI so any push in the right direction is helpful.
$( init );
function init() {
$('.square, .round').draggable({
containment: '#layout-area', start: function(event, ui) {
// Show start dragged position of image.
var Startpos = $(this).position();
$("div#start").text("START:
X: "+ Startpos.left + "
Y: " + Startpos.top);
},
// Find position where image is dropped.
stop: function(event, ui) {
// Show dropped position.
var Stoppos = $(this).position();
$("div#stop").text("CURRENT:
X: "+ Stoppos.left + "
Y: " + Stoppos.top);
}
});
}
$(document).ready(function() {
var params = {
// Callback fired on rotation start.
start: function(event, ui) {
},
// Callback fired during rotation.
rotate: function(event, ui) {
},
// Callback fired on rotation end.
stop: function(event, ui) {
},
};
$('#table, #table1, #table2, #table3, #table4, #table5').rotatable(params);
});
Thanks!