1
我改变一个iframe的属性与JavaScript像这样:让iframe的滚动条消失
var iFrame = window.top.document.getElementById('window_content');
iFrame.setAttribute("height","63");
iFrame.setAttribute("scrolling","no");
iFrame.style.overflow="hidden";
iFrame.style.height = "63px";
它改变大小,我想,但滚动条不会消失。这可能吗? html输出看起来像我所期望的:
<iframe width="650" height="63" frameborder="0" scrolling="no" src="http://www.google.com/" id="window_content" name="window_content" style="overflow: hidden; height: 63px; width: 650px;"> </iframe>
为什么滚动属性无法识别?
是啊,它的怪异。我想这是因为我重新设置与JS的属性。如果我编辑萤火虫中的html,改变iframe的任何内容,滚动条消失。 – Zac