来源:http://itindex.net/blog/2011/12/27/1324977447270.html
如何用jQuery做浏览器类型判断和分辨率判断,直接贴代码:
<SCRIPT type="text/javascript">
var bHeight=$(window).height()-$('.ui-layout-south').height()-$('.ui-layout-north').height();
$("#page").css({height:bHeight+'px'});
$(function() {
if($.browser.msie) {
}
else if($.browser.safari) {//contains chrome
}
else if($.browser.mozilla) {
}
else if($.browser.opera) {
}
else {
//alert("i don't konw!");
}
});
</SCRIPT>
<script type="text/javascript">
$(document).ready(function()
{
//alert($(window).height()); //浏览器当前窗口可视区域高度
//alert($(document).height()); //浏览器当前窗口文档的高度
//alert($(document.body).height());//浏览器当前窗口文档body的高度
//alert($(document.body).outerHeight(true));//浏览器当前窗口文档body的总高度 包括border padding margin
//alert($(window).width()); //浏览器当前窗口可视区域宽度
//alert($(document).width());//浏览器当前窗口文档对象宽度
//alert($(document.body).width());//浏览器当前窗口文档body的高度
//alert($(document.body).outerWidth(true));//浏览器当前窗口文档body的总宽度 包括border padding margin
alert(screen.height);//显示器分辨率,只能用JavaScript代码获取
alert(screen.width);
})
</script>
来源:http://e7show.net/index.php?option=com_content&view=box&vid=20120102165220
[code]//返回当前页面高度
function pageHeight(){
if($.browser.msie){
return document.compatMode == "CSS1Compat"? document.documentElement.clientHeight :
document.body.clientHeight;
}else{
return self.innerHeight;
}
};
//返回当前页面宽度
function pageWidth(){
if($.browser.msie){
return document.compatMode == "CSS1Compat"? document.documentElement.clientWidth :
document.body.clientWidth;
}else{
return self.innerWidth;
}
}; [/code]
如何用jQuery做浏览器类型判断和分辨率判断,直接贴代码:
<SCRIPT type="text/javascript">
var bHeight=$(window).height()-$('.ui-layout-south').height()-$('.ui-layout-north').height();
$("#page").css({height:bHeight+'px'});
$(function() {
if($.browser.msie) {
}
else if($.browser.safari) {//contains chrome
}
else if($.browser.mozilla) {
}
else if($.browser.opera) {
}
else {
//alert("i don't konw!");
}
});
</SCRIPT>
<script type="text/javascript">
$(document).ready(function()
{
//alert($(window).height()); //浏览器当前窗口可视区域高度
//alert($(document).height()); //浏览器当前窗口文档的高度
//alert($(document.body).height());//浏览器当前窗口文档body的高度
//alert($(document.body).outerHeight(true));//浏览器当前窗口文档body的总高度 包括border padding margin
//alert($(window).width()); //浏览器当前窗口可视区域宽度
//alert($(document).width());//浏览器当前窗口文档对象宽度
//alert($(document.body).width());//浏览器当前窗口文档body的高度
//alert($(document.body).outerWidth(true));//浏览器当前窗口文档body的总宽度 包括border padding margin
alert(screen.height);//显示器分辨率,只能用JavaScript代码获取
alert(screen.width);
})
</script>
来源:http://e7show.net/index.php?option=com_content&view=box&vid=20120102165220
[code]//返回当前页面高度
function pageHeight(){
if($.browser.msie){
return document.compatMode == "CSS1Compat"? document.documentElement.clientHeight :
document.body.clientHeight;
}else{
return self.innerHeight;
}
};
//返回当前页面宽度
function pageWidth(){
if($.browser.msie){
return document.compatMode == "CSS1Compat"? document.documentElement.clientWidth :
document.body.clientWidth;
}else{
return self.innerWidth;
}
}; [/code]