2011-07-11 12 views
1

を消す私はそうのようなJavaScriptでのiframeのプロパティを変更しています:は、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> 

なぜスクロール属性が認識されませんか?

答えて

1

私のために完全に正常に動作しているようだ:

http://jsfiddle.net/maniator/XSfzg/

これは、最新のGoogle Chromeです。

+0

いや..私は私はJSで属性を再設定していますので、それがあると思います。 Firebugでhtmlを編集し、iframeについて何か変更すると、スクロールバーが消えます。 – Zac

0

はこれを試してみてください。その奇妙な

iframe.style.overflowX = "hidden"; 
iframe.style.overflowY = "hidden"; 
関連する問題