body,html{
padding:0px;
margin:0px;
}
.containner{
width: 100%;
background-color: green;
}
var screenHeight = window.screen.height;
var availHeight = window.screen.availHeight;
var heightnum = heightNum();
$(".containner").css("height",heightnum);
function myBrowser(){
var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
if (userAgent.indexOf("Firefox") > -1) {
return "FF";
} //判断是否Firefox浏览器
if (userAgent.indexOf("Chrome") > -1){
return "Chrome";
}
if(!!window.ActiveXObject || "ActiveXObject" in window){
return "IE";
}//判断是否IE浏览器
}
function heightNum(){
var height;
var mb = myBrowser();
if ("IE" == mb) {
height = availHeight-78
}
if ("FF" == mb) {
height = availHeight-93
}
if ("Chrome" == mb) {
height = availHeight-66
}
return (height+"px")
}
点赞 (0)赏分享 (0)