iFrame没有正确关闭在jQuery UI中

时间:2011-05-09 19:17:28

标签: javascript html jquery-ui video iframe

现在,我通过jQuery UI在iFrame中设置了视频。在Firefox中我没有任何问题,但对于IE和Chrome,尽管关闭了弹出对话框,音频仍在继续。

jQuery UI代码中是否有解决方法?

感谢。

<script type="text/javascript">

    function openDialog(url) {
        $("<div class='popupDialog'>Loading...</div>")
            .dialog({
                autoOpen: true,
                closeOnEscape: true,
                width: '900',
                height: '900',
                modal: true,
                title: 'Bonus Features'
            }).bind('dialogclose', function() {
                jdialog.dialog('destroy');
            }).load(url, function() {
                $(this).dialog("option", "position", ['center', 'center'] );
            });

        adjustJQueryDialogOverlay();
    }

    $(window).resize(function() {
        $(".ui-dialog-content").dialog("option", "position", ['center', 'center']);
    });
</script>

1 个答案:

答案 0 :(得分:1)

在对话框中添加beforeClose以删除元素:

   $("<div class='popupDialog'>Loading...</div>")
        .dialog({
            autoOpen: true,
            closeOnEscape: true,
            width: '900',
            height: '900',
            modal: true,
            title: 'Bonus Features',
            beforeClose: function(){   $(this).remove();   }
        }).load(url, function() {
            $(this).dialog("option", "position", ['center', 'center'] );
        });