こんにちは、画面の大きさに基づいてiframeのCSSの高さを設定したいのですが、これを行う方法がわかりません。
CSS:
#iframeplate{
width:100%;
height:200px;
}
HTML:
<body onload="setGround()">
<iframe id="iframeplate" class="idIframe" frameborder=0 border=0 width="100%" scrolling-y="no" src="#">
</iframe>
</body>
JS:
<script type="text/javascript">
function setGround() {
var groundElement = document.getElementById('iframeplate');
groundElement.style.height = getWindowHeight() + 'px';
}
}
</script>
なぜこれがうまくいかないのか誰にもわかりますか?または、それを行うためのより良い方法に関するアイデアはありますか?