js代码:

function setIframeHeight() {
    
var dHeight = 502//基础高度
    var main = document.getElementById("mainIframe");
    
var left = document.getElementById("leftIframe");
    
//var leftFrame = document.getElementsByName("left")[0];
    var cHeight = main.contentWindow.document.body.scrollHeight; //当前高度
    var sHeight = 0//准备设置的高度值
    if (cHeight <= dHeight) {
        sHeight 
= dHeight + "px";
    } 
else {
        sHeight 
= cHeight + "px";
    }
    main.style.height 
= sHeight;
    left.style.height 
= sHeight;
    
if (left.contentWindow.document.getElementById("leftFrameCont")) {
        left.contentWindow.document.getElementById(
"leftFrameCont").style.height = sHeight;
    }
}

index.jsp部分页面代码:

<div id="content_bottom2" style="width:auto;">
    
<iframe name="left" class="vipIf_left" scrolling="no" marginwidth="0px" frameborder="0" src="left.jsp" id="leftIframe"></iframe>
    
<iframe name="main" class="vipIf_right" frameborder="0" src="main.jsp" onload="setIframeHeight();" id="mainIframe"></iframe>
</div>


left.jsp部分页面代码:

解决上左右页面框架中iframe的引起的滚动条问题<body>
解决上左右页面框架中iframe的引起的滚动条问题    
<div class="cont_left" id="leftFrameCont">
解决上左右页面框架中iframe的引起的滚动条问题        
解决上左右页面框架中iframe的引起的滚动条问题解决上左右页面框架中iframe的引起的滚动条问题
解决上左右页面框架中iframe的引起的滚动条问题    
</div>
解决上左右页面框架中iframe的引起的滚动条问题
</body>

 

相关文章:

  • 2021-10-26
  • 2021-12-11
  • 2022-01-16
  • 2022-02-06
  • 2022-12-23
  • 2022-02-15
  • 2022-12-23
  • 2022-02-17
猜你喜欢
  • 2022-02-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-15
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案