Obtener el tamaño de la ventana JavaScript
var w = window.innerWidth;
var h = window.innerHeight;
VasteMonde
var w = window.innerWidth;
var h = window.innerHeight;
const window {
width: window.innerWidth,
height: window.innerHeight
}
// better than using window.innerWidth / window.innerHeight
// because of scrollbars
const client = {
width: document.documentElement.clientWidth,
height: document.documentElement.clientHeight
}
window.screen.width
//or just
screen.width
// Size of browser viewport.
$(window).height();
$(window).width();
// Size of HTML document (same as pageHeight/pageWidth in screenshot).
$(document).height();
$(document).width();
var win = window,
doc = document,
docElem = doc.documentElement,
body = doc.getElementsByTagName('body')[0],
x = win.innerWidth || docElem.clientWidth || body.clientWidth,
y = win.innerHeight|| docElem.clientHeight|| body.clientHeight;
alert(x + ' × ' + y);