<iframe id="iframe_0" src="login.jsp" width="100%" height="100%" onload="changeFrameHeight(this)" scrolling="yes" frameborder="no" border="0" marginwidth="0" marginheight="0" allowtransparency="yes"> </iframe> function changeFrameHeight(that){ //电脑屏幕高度-iframe上面其他组件的高度 //例:我这里iframe上面还有其他一些div组件,一共的高度是120,则减去120 $(that).height(document.documentElement.clientHeight - 120); }