However tin I acquire windowWidth
, windowHeight
, pageWidth
, pageHeight
, screenWidth
, screenHeight
, pageX
, pageY
, screenX
, screenY
which volition activity successful each great browsers?
These days, for surface measurement you tin usage the screen
entity:
window.screen.height;window.screen.width;
Bequest
You tin acquire the measurement of the framework oregon papers with jQuery:
// Size of browser viewport.$(window).height();$(window).width();// Size of HTML document (same as pageHeight/pageWidth in screenshot).$(document).height();$(document).width();
This has the whole lot you demand to cognize: Acquire viewport/framework measurement
however successful abbreviated:
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);
Delight halt enhancing this reply. It's been edited 22 instances present by antithetic group to lucifer their codification format penchant. It's besides been pointed retired that this isn't required if you lone privation to mark contemporary browsers - if truthful you lone demand the pursuing:
const width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;const height = window.innerHeight|| document.documentElement.clientHeight|| document.body.clientHeight;console.log(width, height);
Mistake producing weblog contented
my tummy looks like this 🫠👀 #ashortaday
my tummy looks like this 🫠👀 #ashortaday from Youtube.com