获取浏览器可用高度

来源:互联网 发布:android 开发mac 教程 编辑:程序博客网 时间:2024/06/05 07:24
<script language="javascript" type="text/javascript"> function onload(){var width = 0;var height = 0;if(navigator.userAgent.indexOf("Firefox")>0) {//是否是火狐.height = document.body.scrollHeight;} else {height = document.documentElement.scrollHeight;}alert(height:" + height);}onload();</script>

最后使用jquery:

$(window).height();  //一行代码搞定.


jquery常用:

http://www.wufangbo.com/jquery-tips/

原创粉丝点击