1
下面是我初始化的對話框:如何關閉與IFRAME一個jQuery UI的對話框
$('a.dialog').click(function(e) {
e.preventDefault();
var $this = $(this);
$('<iframe id="externalSite" class="externalSite" src="/controller/action" frameBorder="0"></iframe>').dialog({
modal: true,
resizable: false,
title: 'Title',
zIndex: 1,
show: 'fast',
hide: 'slow',
width: 600,
height: 400,
position: 'middle'
}).width(600);
});
我怎樣才能關閉它從iframe中?
例如,我想有iframe內的一個鏈接,關閉該對話框。
或'window.top $找到( '#externalSite')對話框( '親密');。'直接使用jQuery對象的父窗口上,萬一框架中的頁面不需要/需要jQuery本身。 – Pointy 2010-10-22 14:14:55
這不起作用。但是這樣做:$(window.top.document).find('。ui-widget-overlay,.ui-dialog')。remove(); – 2010-10-22 14:25:28
@Richard我不熟悉瑞API,貌似這就是所謂的「破壞」:http://jqueryui.com/demos/dialog/#method-destroy – 2010-10-22 14:28:48