$("#here").droppable({
tolerance: 'fit',
accept: ".accepted",
drop: function(event, ui) {
var draggable = ui.draggable;
var id = draggable.attr("id");
$.post('changelocation.php', {
fileid: id
}, function(data) {
alert(data);
});
//handling for success..
}
});
I have the code above and my problem is that the php file is posted when started dragging, and again when dropped successfully. I've checked this with google chrome debug tools... My draggable script is this:
$(".accepted").draggable({
start: function() {
$(this).addClass('dragged');
$('.accepted').not(this).addClass('others');
},
revert: 'invalid',
snap: ".snap",
snapMode: "outside",
obstacle: ".others",
preventCollision: true,
stop: function() {
$(this).removeClass('dragged');
$('.accepted').not(this).removeClass('others');
}
});
What could make this post when started dragging??
obstacle
andpreventCollision
options are not supported by jQuery UI's draggable. Is there something you're not telling us? ;) – DarthJDG 1 hour ago