我这有个不出现滚动条的代码.放在iframe包含的页中..
<!--
function changeIframeHeight() //自动改变 Iframe 的高度
{
if(window.top != window.self)
{
if(document.body.scrollHeight>=450)
window.parent.document.all.inchtm.height = document.body.scrollHeight+10;
else
window.parent.document.all.inchtm.height=450;
}
}
function window.onload()
{
changeIframeHeight(); //改变 Iframe 高
}
//-->
你可以试着这样设一下:
<iframe id="ifrRight" name="ifrRight" src="" frameBorder="0" width="785" height="495" scrolling="auto"></iframe>即scrolling="auto",我没测试.
<!--
function changeIframeHeight() //自动改变 Iframe 的高度
{
if(window.top != window.self)
{
if(document.body.scrollHeight>=450)
window.parent.document.all.inchtm.height = document.body.scrollHeight+10;
else
window.parent.document.all.inchtm.height=450;
}
}
function window.onload()
{
changeIframeHeight(); //改变 Iframe 高
}
//-->
你可以试着这样设一下:
<iframe id="ifrRight" name="ifrRight" src="" frameBorder="0" width="785" height="495" scrolling="auto"></iframe>即scrolling="auto",我没测试.
解决方案 »
- 关于IE8,IE9不跨域,却拒绝访问的问题
- WIN 2003下使用IE8遇到的问题
- 没人能解答的问题?ie8中,iframe存在后,jquery动画时间失效
- 小JS问题一个
- 怎么样调用另一页的javascript函数??
- 网页对话框中的页面如何在对话框中刷新?
- 页面刷新
- 如何使IE窗口一打開就最大化?(點擊右上角最大化按鈕之后的效果)
- 图片自动缩放问题.
- 为什么会出错,Uncaught ReferenceError: text is not defined ,求路过的大神指导
- 如何从iframe中访问母页面中的元素?
- HTML 页面的content-type设为application/vnd.ms-excel;charset=UTF-8所出的问题
function aa()
{
window.ifrRight.location.href="1.html";
}
</script><form name="form1" method="post" action="">
<input type="button" value="test" onclick="aa();">
<iframe id="ifrRight" name="ifrRight" src="" frameBorder="0" width="500" height="300" scrolling="auto"></iframe>
</form>你做个1.html做得很长 然后放在这个文件同一个目录下
马上结帖