0
我正在嘗試jquery上下文菜單。它的工作正常。我的代碼如下如何停止jQuery的上下文菜單時div是空的?
$(function() {
$.contextMenu({
selector: '.droppable',
callback: function (key, options) {
if (key == "delete") {
if ($(this).html() != "") {
$(this).html("");
deleteKey($(this).attr("id"));
}
}
},
items: {
"delete": { name: "Delete", icon: "delete" }
}
});
});
現在我想不打開菜單時($(this).html()==「」)。
當容器的html爲空時,我可以防止菜單在右鍵點擊時打開嗎?
在此先感謝。
Vidhin