We want to know not only the size but whether the user could maximize his browser or whether his screen is just too small. We do this:
>function checkScreen(lcscreen) { var a = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight; var b =window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; var c = screen.availHeight ; var d = screen.availWidth; var e = screen.height; var f = screen.width; var mobile = (/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase())); if (lcscreen == "welcome") { // mobile user if (mobile) { // document.location = "http://www.yoursite.com/mobile.html"; alert('Hi V-Manager mobile user!'); return ; } // their browser is smaller than it can be, they could maximize for v-manager if ( (a < 825 && c> 825) || (b <1345 && d >1345) ) { alert('V-Manager for the Cloud is viewed better at a higher resolution.\n\nYour monitor is ' + d + ' x ' + c + '\n\nBrowser display is ' + b + ' x ' + a + '\n\nFor best use adjust your screen resolution and restart your browser.'); return ; } // they need to actually change their screen resolution if ( a < 825 || b <1345 ) { alert('V-Manager for the Cloud is viewed better at a higher resolution.\n\nYour monitor is ' + d + ' x ' + c + '\n\nBrowser display is ' + b + ' x ' + a + '\n\nFor best use adjust your screen resolution and restart your browser.'); return ; } } } <