我正在尝试删除在我通过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来删除新加载内容的属性和样式?