【发布时间】:2017-01-06 07:18:42
【问题描述】:
我一直在尝试设置一个 div 以使用 jquery 对话框弹出
首先,当用户单击按钮并打开对话框时,当他关闭对话框时,它会在第一次单击时关闭。
当他第二次尝试关闭对话框时,它会再次打开相同的弹出窗口,他需要再次单击关闭按钮才能将其关闭。
https://jsfiddle.net/xwpwku1w/31/
jQuery:
function ShowMyContainerDivForSC(containerID, title, width, height) {
if ($(containerID).data('uiDialog'))
$(containerID).dialog('destroy');
$(containerID).dialog({
width: width,
draggable: true,
height: height,
resizable: false,
title: title,
modal: false,
open: function (event, ui) {
$(this).show();
},
close: function (event) {
if (typeof AfterClose == "function") {
AfterClose(containerID);
}
//$(this).remove();-- commented cause it just removes the element.
}
});
return false;
}
【问题讨论】:
-
你能创建一个 jsfiddle 吗?
-
你是从哪里复制粘贴的? >
-
从这里,我尝试添加 jquery。但不工作 - jsfiddle.net/AvF8V
-
您在问题中添加的jsfiddle 似乎没有任何弹出对话框。
标签: javascript jquery jquery-ui-dialog