javascript - Add ID when draggable is dropped in a droppable zone - jQuery Draggables -
i'm using jquery draggables on page:
once user has dragged 1 of draggables drop zone, i've added fadein
button "save" value dragged there.
i want content (word) inside draggable placed in drop zone. think need add id when particular draggable added particular droppable zone.
then can use getelementbyid
grab inner value.
my issue is, adding id using following:
$('element').attr('id', 'value');
but i'm unsure how select draggable placed in dropzone time... not of draggables on page.
this code when dropped in place:
drop: function() { $(this).droppable('disable'); },
above code used disable droppable zone (and stick draggable in place, cannot removed).
the element should passing function try following:
drop: function(event, ui) { alert(ui.draggable.text()); },
Comments
Post a Comment