tod
0
Q:

js know size of screen

window.onresize = function(){
console.log("resize");
}
1
alert("Your screen resolution is: " + screen.width + "x" + screen.height)
3
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);
2
window.screen.height;
window.screen.width;
0

New to Communities?

Join the community