基于解决方案您已经找到了如何将CSS应用于iframe?:
var csslink = document.createElement("link") csslink.href = "file://path/to/style.css"; csslink .rel = "stylesheet"; csslink .type = "text/css"; frames['iframe'].document.body.appendChild(csslink);
或更多jqueryish(从使用jQuery将样式表附加到iframe):
var $head = $("iframe").contents().find("head"); $head.append($("<link/>", { rel: "stylesheet", href: "file://path/to/style.css", type: "text/css" }));
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)