<iframe id="ym-iframe" src="Login.aspx" width="300" height="300"></iframe>
<script type="text/javascript">
document.getElementById("ym-iframe").scrolling = 'no';
alert(document.getElementById("ym-iframe").scrolling);
</script>如上面的javascirpt已经设置scrolling =no了
但显示的iframe他还是有滚动条的,
要怎么用js进行改变呢谢谢
(ifm.contentWindow || ifm).document.body.style.overFlow='hidden';
<iframe id="ym-iframe" src="Login.aspx" width="300" height="300"></iframe>
<script type="text/javascript">
window.onload = function(){
document.getElementById("ym-iframe").contentWindow.document.body.style.overflow = "hidden";
}
</script>
<iframe width="100%" height="100%" src="otherpage.jsp" scrolling="no" frameborder="0" marginwidth="0" marginheight="0" name="main" onload=document.all("main").height=main.document.body.scrollHeight>
</iframe>注意,3个main必须相同。
window.onload = function()
{
var ifm = document.getElementById("ym-iframe");
(ifm.contentWindow || ifm).document.body.style.overFlow = 'hidden';
alert((ifm.contentWindow || ifm).document.body.style.overFlow);
}
</script>
上面这样,我的iframe还是有滚动条,
但我alert出来已经是hidden了谢谢
谢谢