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