Detecting browser client area size on wide screen using javascript -


I am using the following code to find out the breadth of the browser client area for ages and with it all the browsers Although different versions of 100% FF, Safari and IE, now when I switch to a new monitor with Widescreen resolution (1280x800), this code fails on IE8. This clientwid reports 1024! !!!

Any ideas how to get the correct client width of the field?

  function getClientWidth () {var v = 0, d = document, w = window; If ((!! D Kapomod || D Kapmed == 'CSS 1 Compact') & amp;; woopera & amp; amp; amp; d.documentElement & amp; amp; and · d.documentElement ClientWidth] {V = d.documentElement.ClientWidth;} and if (D.and.D.body.clientWidth) {v = d.body.clientWidth;} and if (xDef (w.innerWidth, w.innerHyight, d) .height)) {v = w.innerWidth; if (D. Height> w.innerHeight) V- = 16;} Return V;}  

  function detectBrowserSize () {var myWidth = 0, myHeight = 0; if (type window.innerWidth == 'number') {// non-IE myWidth = window.innerWidth; MyHeight = window.innerHeight;} and Ghar (document.documentElement & amp; amp; document.documentElement.clientWidth || document.documentElement.clientHeight)) {// IE 6+ in 'standard compatible mode' myWidth = document.documentElement.clientWidth; MyHeight = document .documentElement.clientHeight;} and if (document.body & amp; Amp; (Document.body.clientWidth || document.body.clientHeight)) {// IE4 compatible myWidth = document.body.clientWidth; MyHeight = document.body.clientHeight; } Warning (myWidth + '-' + myHeight)}  

Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -