2017-01-06 37 views
1

我一直在试图建立一个div使用jQuery的对话框弹出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; 
} 
+0

您可以创建一个的jsfiddle? –

+0

你是从哪里复制粘贴的? > – Phix

+0

从此,我试图添加的jQuery。但不工作 - http://jsfiddle.net/AvF8V – pvaju896

回答