xxxxxxxxxx
var w = window.innerWidth;
var h = window.innerHeight;
xxxxxxxxxx
if (window.screen.width >= 1024 && window.screen.height >= 768) {
alert('screen is ${window.screen.width} x ${window.screen.height}')
}
xxxxxxxxxx
// Get the screen size in pixels
var screenWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
var screenHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
console.log("Screen Width: " + screenWidth);
console.log("Screen Height: " + screenHeight);
function winSize() {
console.log(`
Outer Width: ${this.outerWidth}
Outer Height: ${this.outerHeight}
`);}
winSize();