cant 'register' draggable/active DIV
HI, im trying to send the position of X amount of divs to a DB, my problem is, what i think, that the current div
being dragged isn't registered. Im trying to alert
alert( $(this).attr("id") );
but only receiving 'undefined'
/C
- $(".flytt").draggable({
- stop: function() {
- var data_pos = $(this).position();
-
- $.post("save_pos.php", { id: $(this).attr("id"), x: Math.floor(data_pos.left), y: Math.floor(data_pos.top) },
- function (data)
- {
- if (data == 1) {
- alert( "Saved" );
- }else{
- alert( $(this).attr("id") );
- }
-
- });
- }
- });
-