0

我正在尝试删除在我通过 colorbox iframe 拉入的页面中的某些表格上产生的一些内联样式。

jQuery:

$('.w_price_assess p.price_report > a').colorbox({
    title: 'Price report',
    transition: 'elastic',
    innerWidth: '900px',
    innerHeight: '699px',
    opacity: '0.5',
    iframe: true,
    onComplete: function() {
        // Call the dialog header and append
        $.ajax({
            type: 'GET',
            url: '../Content/dialog_head.htm',
            dataType: 'html',
            cache: false,
            success: function(data) {
                $('#cboxTitle').append(data);
            },
            error: function(xhr, ajaxOptions, thrownError) {
                alert(xhr.status);
                alert(thrownError);
            }

        });

        // re-initialise scroll bars
        $('#cboxLoadedContent').jScrollPane();

        // load colorbox print CSS
        $('head').append('<link rel="stylesheet" type="text/css" href="../Content/styles/icis.dashboard.colorbox.print.css" media="print">');

        // give iframe unique ID
        $('#cboxLoadedContent iframe').attr('id', 'color_frame');
        // remove widths on tables in iframe
        $('#cboxLoadedContent iframe table').removeAttr('width');

    }
});

是否需要在新文档的头部应用 jQuery 来删除新加载的内容的属性和样式?

4

1 回答 1

1

我相信您所要做的就是使用委托事件。因为它是在加载窗口后加载的。

于 2010-07-16T10:54:52.983 回答