我正在尝试 Jquery 上下文菜单。它工作正常。我的代码如下
$(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 为空白时,我可以阻止菜单在右键单击时打开吗?
提前致谢。
维丁