去掉iframe横向滚动条_iframe滚动条

主页面加IFRAME SCROLLING="YES"
子页面
'让竖条消失: 
 
 
'让横条消失: 
 

'还要去掉
'子页面里的

'两个都去掉
iframe自动适应页面大小JS函数
//Iframe自适应高度/宽度  
function dynIframeAutoSize(iFrameName,autoType) 

debugger 
var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]; 
//extra height in px to add to iframe in FireFox 1.0+ browsers 
//高度 
var FFextraHeight=getFFVersion>=0.1? 16 : 0 ; 
//宽度 
var FFextraWidth=getFFVersion>=0.1? 16 : 0 ; 
var objElement = null; 
if (document.getElementById) 
objElement = document.getElementById(iFrameName); 
else 
eval('pTar = ' + iFrameName + ';'); 
if (objElement && !window.opera) 

//begin resizing iframe 
objElement.style.display="block"; 
switch(autoType) 

case "height": 
//高度 
if (objElement.contentDocument && objElement.contentDocument.body.offsetHeight) 
//ns6 syntax 
objElement.height = objElement.contentDocument.body.offsetHeight+FFextraHeight; 
else if (objElement.Document && objElement.Document.body.scrollHeight) 
//ie5+ syntax 
objElement.height = objElement.Document.body.scrollHeight; 
break; 
case "width": 
//宽度 
if (objElement.contentDocument && objElement.contentDocument.body.offsetWidth) 
//ns6 syntax 
objElement.width = objElement.contentDocument.body.offsetWidth+FFextraWidth; 
else if (objElement.Document && objElement.Document.body.scrollWidth) 
//ie5+ syntax 
objElement.width = objElement.Document.body.scrollWidth; 
break; 
default: 
//适应大小(高和宽)  
//高度 
if (objElement.contentDocument && objElement.contentDocument.body.offsetHeight) 
//ns6 syntax 
objElement.height = objElement.contentDocument.body.offsetHeight+FFextraHeight; 
else if (objElement.Document && objElement.Document.body.scrollHeight) 
//ie5+ syntax 
objElement.height = objElement.Document.body.scrollHeight; 
//宽度 
if (objElement.contentDocument && objElement.contentDocument.body.offsetWidth) 
//ns6 syntax 
objElement.width = objElement.contentDocument.body.offsetWidth+FFextraWidth; 
else if (objElement.Document && objElement.Document.body.scrollWidth) 
//ie5+ syntax 
objElement.width = objElement.Document.body.scrollWidth; 
break; 


}
方法一:在父页面中

iframe中页面:
function window.onload()
{
var div = window.parent.document.getElementById('div1');
div.style.height=document.body.scrollHeight+20;
}
方法二:

使用的时候只要贴在里面就可以了

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29753604/viewspace-1291839/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/29753604/viewspace-1291839/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值