+ -
当前位置:首页 → 问答吧 → 具体怎么使用----好像没啥效果啊

具体怎么使用----好像没啥效果啊

时间:2011-07-05

来源:互联网

$(window).resize(function(){
  $('#gridPager').datagrid('resize', {
  width:function(){return document.body.clientWidth;},
  height:function(){return document.body.clientHeight;},
  });
});

clientWidth ?
clientHeight ?

作者: xiaoxing18   发布时间: 2011-07-05

JScript code
function getScreenSize()
{
    var theWidth,theHeight;
    if (window.innerWidth) 
    { 
        theWidth = window.innerWidth 
        theHeight = window.innerHeight 
    } 
    else if (document.compatMode=='CSS1Compat') 
    { 
        theWidth = document.documentElement.clientWidth 
        theHeight = document.documentElement.clientHeight 
    } 
    else if (document.body) 
    { 
        theWidth = document.body.clientWidth 
        theHeight = document.body.clientHeight 
    } 
    var result = [theWidth,theHeight];
    return result;
}

var array =  getScreenSize()
//高:array[1]
//宽:array[0]

作者: aspwebchh   发布时间: 2011-07-05

引用 1 楼 aspwebchh 的回复:

JScript code
function getScreenSize()
{
var theWidth,theHeight;
if (window.innerWidth)
{
theWidth = window.innerWidth
theHeight = window.innerHeight
}
else i……
修改计算方式

作者: xuexiaodong2009   发布时间: 2011-07-05