I have a strange problem with droppable. http://jsfiddle.net/samanth/dykcV/16/ This example works very well. Once I drop a div on the droppable, it does not allow me to drop anything else on that. I have the same piece of code in my application, but the droppable accepts drops.
I have an AJAX call before making a drop. Could this be a problem?
Here is my actual code.
$(".dropItem").droppable({
accept:'.dragItem',
hoverClass: 'hovered',
drop:function (event, ui) {
var answerNumber = $(this).attr( 'id' );
var questionNumber = ui.draggable.attr( 'id' );
$(this).append($(ui.draggable));
//Send ajax query and get the response here..
// generating form data
send('matchAnswer?gameId=' + gameId + '&answerId=' + answerNumber + '&questionId=' + questionNumber, function (e) {
if (this.status == 200) {
var resp = this.responseText;
if ( resp == "true" ) {
$(ui.draggable).css ({ position:"relative", top:"0px", left:"0px" }).draggable ("disable").css ({ opacity : 1 });
$(this).droppable('option', 'disabled', true);
} else {
// do something here
}
}
}, formData);
}
});