Ber*_*dan 8 html javascript css iframe
我希望有一个iframe尽可能多的垂直空间,因为它需要显示其内容而不显示滚动条.它可能吗?
有没有解决方法?
cee*_*yoz 10
这应该将IFRAME高度设置为其内容的高度:
<script type="text/javascript">
the_height = document.getElementById('the_iframe').contentWindow.document.body.scrollHeight;
document.getElementById('the_iframe').height = the_height;
</script>
Run Code Online (Sandbox Code Playgroud)
您可能希望添加scrolling="no"到您IFRAME关闭滚动条.
编辑:哎呀,忘了申报the_height.
| 归档时间: |
|
| 查看次数: |
4510 次 |
| 最近记录: |