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

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

 

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

 

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

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

}

 

 

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

posted @ 2018-08-15 11:16  笨笨!  阅读(359)  评论(0编辑  收藏  举报