function fixHeight() {
var headerHeight = $("#switcher").height();
$("#iframe").attr("height", $(window).height() + "px");
}
$(window).resize(function() {
fixHeight();
}).resize();
//iframe页面自适应
function setIframeHeight(iframe) {
if (iframe) {
var iframeWin = iframe.contentWindow || iframe.contentDocument.parentWindow;
if (iframeWin.document.body) {
iframe.height = iframeWin.document.documentElement.scrollHeight || iframeWin.document.body.scrollHeight - 20;
}
}
}
js自适应
最新推荐文章于 2023-05-22 08:58:03 发布