I wanted to restore the position of red block which is a draggable div on the green and gray block and not in blue block it is not worked on green block but it worked on gra
I have not used draggable jquery but would
$("#nodrag").droppable({drop: function() { $('#draggable').css({top:'0px',left:'0px'});}});
work?
Looking further into the draggable stuff there isn't an obvious way to the revert with blocks inside valid elements so I would do the folllowing
$("#draggable").draggable('option', 'start', function(){
//when drag starts save the positions somewhere
$(this).data('left',$(this).css('left')).data('top',$(this).css('top'))
});
$("#nodrag").droppable({drop: function(e,ui) {
//when dropped on an invalid block move it back to where it was (you could change this to animate to mimic revert)
$(ui.draggable)
.css({left:$(ui.draggable).data('left'),top:$(ui.draggable).data('top')});
}});