通过js动态设置 让ifram的高度自动适应被引入页面的高度

来源:互联网 发布:asp商城网站系统源码 编辑:程序博客网 时间:2024/05/19 19:34
function setIframeHeight(iframe) {    var fr=$("#iframe");    fr.get(0).height=0;    if (iframe) {        var iframeWin = iframe.contentWindow || iframe.contentDocument.parentWindow;        if (iframeWin.document.body) {            iframe.height = iframeWin.document.documentElement.height || iframeWin.document.body.scrollHeight;        }    }}
0 0
原创粉丝点击