我正在创建并附加一个可放置的div元素,如下所示:
var drop = {
drop: function(event, ui) {
var add = $("#"+this.id);
$('<div id='+counter+' "><div class="myCss">here</div></div>').droppable( drop ).appendTo( "#myDivs");
//debugger;
counter++;
}
};
我是否可以更新此div以仅允许删除某个id或css的div?
答案 0 :(得分:1)
是
.droppable(
drop: function(event, ui) {
var targetId = $(this).attr("id");
//your conditions to check id/class of div .
if (targetId == '<your div id to restrict>'){
return;
}
}
)