[轉]jQuery UI 关闭父窗口打开的Dialog

From : http://king2009163-163-com.iteye.com/blog/1233878

 

父窗口中定义了如下的div和iframe

<div class="hide" style="overflow: hidden;" id="divdialog">
      <iframe src="" style="width: 100%; border: 0px; height: 100%; overflow:hidden;" allowtransparency="true" frameborder="0" scrolling="no"></iframe>
</div>

 

<tr id="<%#Eval("ID")%>" ondblclick="showDialog('XXX', '/child.aspx',800,685, function() { document.location.reload(); })">

 

// 打开Dialog

function showDialog(title, url, width, height, close) {
  $("#divdialog iframe").attr("src", url);
  $("#divdialog").dialog({ modal: true, title: title, width: width, height: height, show: 'fade', hide: 'fade', resizable: false, close: close });
}

 

 

在子窗口中调用如下的js进行关闭这个弹出的jquery ui dialog

window.parent.$("#divdialog").dialog("close");

 

Baidu : http://www.baidu.com/s?bs=jquery+ui+dialog&f=8&rsv_bp=1&rsv_spt=3&wd=jquery+ui+dialog%B4%F2%E9_%B4%B0%BF%DA%D4%DAiFRAME%C9%CF%C3%E6&inputT=16359

posted @ 2012-02-06 09:02  Athrun  阅读(1588)  评论(0编辑  收藏  举报