无法获取浏览器窗口的宽度和高度了 你在样式表里加一句代码:html, body{height: 100%; max-height:100%;}就可以修正这个BUG了。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 function fGetViewPortSize() {// shawl.qiu script var myWidth = 0, myHeight = 0; if(typeof(window.innerWidth ) == 'number' ) {//Non-IE myWidth = window.innerWidth; myHeight = window.innerHeight; } else if ( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {//IE 6 myWidth = document.documentElement.clientWidth; myHeight = document.documentElement.clientHeight; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 myWidth = document.body.clientWidth; myHeight = document.body.clientHeight; } return [myWidth, myHeight];} // end function fGetViewPortSize 怎么说?这个原来是bug吗,可是我用了你说的方法怎么不起作用呢,还是和原来一样。我的页面开始两行是这样的<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"> xml做数据库,js读取xml中的文档(产品的详细信息,图片,链接) 求一个简单的ubb编辑器 我这样ajax 为什么返回的是undefined???????? 问个弱弱的问题,关于光标定位 ActiveX控件问题。 js对超链的操作问题 求助:关于文本框和下拉列表框的组合问题 怎么模拟鼠标点击一个按扭 javascript中怎样访问table mousedown()左键无效 div的background-color设置为transparent后,就变成中空的了吗 确山删除,点击删除怎么还提交啊?
{// shawl.qiu script
var myWidth = 0, myHeight = 0;
if(typeof(window.innerWidth ) == 'number' )
{//Non-IE
myWidth = window.innerWidth;
myHeight = window.innerHeight;
}
else if
(
document.documentElement &&
( document.documentElement.clientWidth || document.documentElement.clientHeight )
)
{//IE 6
myWidth = document.documentElement.clientWidth;
myHeight = document.documentElement.clientHeight;
}
else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
{ //IE 4
myWidth = document.body.clientWidth;
myHeight = document.body.clientHeight;
}
return [myWidth, myHeight];
} // end function fGetViewPortSize
我的页面开始两行是这样的
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">