$(".droppable").droppable({ drop: function(event, ui) {
var fileName = $(ui.draggable).attr("src").match(/[\/|\\]([^\\\/]+)$/); // get filename.
var url = $("#hurl").val();
if ( $(ui.draggable).attr('name') == "template")
url = $("#turl").val();
var obj = $(ui.draggable).clone().attr("src",url+fileName[1]).css("width","345px").css("height","215px");
$(this).empty();
obj.draggable({
distance: 100,
helper: 'clone',
opacity : 0.35,
revert: 'valid',
stop: function(event, ui) {
$(this).remove();
}
} //obj.draggable
);
$(this).append(obj);
},//drop:
accept : ".draggable_template"
}
);
above code worked for IE7, IE6, firefox 3, chrome, opera 10beta, but not safari 4. the problem is in
stop: function(event, ui) {
$(this).remove();
}
In safari 4, this piece of code is not be called.