2009年4月22日星期三

如何获取浏览器窗口的高度

用这行代码:document.documentElement.clientHeight
<body>
<p style="height:1000px;">
<script type="text/javascript">
document.write("document.documentElement.clientHeight:"+document.documentElement.clientHeight +"<br />");
document.write("document.body.offsetHeight:"+document.body.offsetHeight +"<br />");
</script>
</p>
</body>

没有评论:

发表评论