iframe1(跨页面父子页面问题)

  <iframe id="iframe1" data-bind="attr: { src: $root.Basic_Form_ReportID }" frameborder="0" style="height: 550px;100%"></iframe>

//加载自定义样式
ContentStr += "<style id='CustomCss'></style>";

function AfterContentStrCteated() {
var css = ".inblock2{33%}";

document.getElementById("iframe1").contentWindow.viewModel.CreatCustomCss(css)

}

//加载完报表以后,执行自定义样式
if (window.parent && window.parent.AfterContentStrCteated) {
window.parent.AfterContentStrCteated();
}

原文地址:https://www.cnblogs.com/benbenjia/p/9480332.html