基于jquery的获取浏览器窗口大小的代码
更新时间:2011年03月28日 18:49:14 作者:
今天正好用到这个,就网上搜了搜,贴出来了。需要的朋友可以参考下。
复制代码 代码如下:
function getTotalHeight(){
if($.browser.msie){
return document.compatMode == "CSS1Compat"? document.documentElement.clientHeight : document.body.clientHeight;
}
else {
return self.innerHeight;
}
}
function getTotalWidth (){
if($.browser.msie){
return document.compatMode == "CSS1Compat"? document.documentElement.clientWidth : document.body.clientWidth;
}
else{
return self.innerWidth;
}
}
var do_height = getTotalHeight();
var do_width = getTotalWidth();
alert("do_height=="+do_height+"\ndo_width=="+do_width);
相关文章
jquery autocomplete自动完成插件的的使用方法
最近刚开始学jquery,想实现类似GOOGLE搜索时自动显示出相关结果的效果。于是选择了使用jquery autocomplete插件。2010-08-08jquery+ajaxform+springboot控件实现数据更新功能
这篇文章主要介绍了jquery+ajaxform+springboot控件实现数据更新操作,使用jquery的ajaxform插件是一个比较不错的选择。具体实现工程大家参考下本文2018-01-01
最新评论