判断屏幕是否全屏

//判断浏览器是否全屏
function isFullscreenForNoScroll() {
var explorer = window.navigator.userAgent.toLowerCase();
if (explorer.indexOf(‘chrome’) > 0) {
//webkit
if (document.body.scrollHeight === window.screen.height
&& document.body.scrollWidth === window.screen.width) {
heightRadio=Number(screenResolutionY)/9001.199;
return true;
} else {
heightRadio=Number(screenResolutionY)/900;
return false;
}
} else {
//IE 9+ fireFox
if (window.outerHeight === window.screen.height
&& window.outerWidth === window.screen.width) {
heightRadio=Number(screenResolutionY)/900
1.199;
return true;
} else {
heightRadio=Number(screenResolutionY)/900;
return false;
}
}
}

//最近自适应分辨率挺多的,找了一个比较合适的判断屏幕是否全屏的方法,仅供参考

你可能感兴趣的:(全屏,自使用分辨率)