/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function getScreenDimentions(){ var screenH = screen.height; var screenW = screen.width; if(document.all){ availW = document.body.clientWidth; availH = document.body.clientHeight; } else{ availW = innerWidth; availH = innerHeight; } var arrScreenDimentions = new Array(); // ALL SIZES ARE WITHOUT 'PX' arrScreenDimentions[0] = screenH // SCREEN HEIGHT arrScreenDimentions[1] = screenW // SCREEN WIDTH arrScreenDimentions[2] = availH // AVAILABLE HEIGHT arrScreenDimentions[3] = availW // AVAILABLE WIDTH return arrScreenDimentions; }