js或jquery获取屏幕高度 显示一个页面 然后通过jquery.append加载元素后 页面高度发生变化 如何获得这时候页面的高度 页面高度 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 var _docHeight = (document.height !== undefined) ? document.height : document.body.offsetHeight;var _docWidth = (document.width !== undefined) ? document.width : document.body.offsetWidth; <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title><script type="text/javascript">var getStyle=function(dom){ if(document.defaultView&&document.defaultView.getComputedStyle){ getStyle=function(x){ var style=document.defaultView.getComputedStyle(x); return style; } }else if(dom.currentStyle){ getStyle=function(x){ return x.currentStyle; } } return getStyle(dom);}window.onload=function(){ var div=document.body; var style=getStyle(document.body); var height=(style.height=='auto'?div.offsetHeight:style.height); alert(height);}</script></head><body><div id="test">1</div><div style="height:2000px"></div></body></html> 好用方便的 地区选择器 控件 同时用setTimeout()刷新几个页面该怎么做? extjs4 grid's cell不可复制问题? 急!高手给个正则,限制必须为汉字、字母、数字3者的任意混合。 这段代码有点不明白,麻烦高人看看 .htc文件是什么文件?有什么用? 求一简单JavaScript函数 在线急等 求一个正则表达式的写法 50分求解!如何使层显示在最前面? websocket用户验证 关于富文本编辑器的问题 新学EXTjS,为什么没有例子出的效果?
var _docWidth = (document.width !== undefined) ? document.width : document.body.offsetWidth;
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript">
var getStyle=function(dom){
if(document.defaultView&&document.defaultView.getComputedStyle){
getStyle=function(x){
var style=document.defaultView.getComputedStyle(x);
return style;
}
}else if(dom.currentStyle){
getStyle=function(x){
return x.currentStyle;
}
}
return getStyle(dom);
}
window.onload=function(){
var div=document.body;
var style=getStyle(document.body);
var height=(style.height=='auto'?div.offsetHeight:style.height);
alert(height);
}
</script>
</head><body>
<div id="test">1</div>
<div style="height:2000px"></div>
</body>
</html>