aui / artDialog

经典的网页对话框组件

Home Page:http://aui.github.com/artDialog/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

窗口销毁 remove,不能删除iframe

doocal opened this issue · comments

这段代码有问题,实际测试。销毁弹窗后(非半闭),dialog 的相关DOM结构删除了,但是内置iframe依然存在。 目前我这边延时(setTimeout)删除就干净了。

api.addEventListener('beforeremove', function () {
      // 重要!需要重置iframe地址,否则下次出现的对话框在IE6、7无法聚焦input
     // IE删除iframe后,iframe仍然会留在内存中出现上述问题,置换src是最容易解决的方法
    $iframe.attr('src', 'about:blank').remove();
}, false);

你好,我是通过将上述代码的 beforeremove 改为 remove 来避免这个bug 的(不知道会不会导致其他问题)。
请问你说的 setTimeout 具体是怎么用? 是在 $iframe.attr('src', 'about:blank').remove(); 这句延时吗?例如:

setTimeout( function(){ $iframe.attr('src', 'about:blank').remove(); }, 100 );

这样吗?盼复