Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #10070

Re: Sizing on android phone

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.chainon-marquant.org!nntpfeed.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail
Content-Type text/plain; charset="ISO-8859-1"
Message-ID <20727073.rOyAWzDM7h@PointedEars.de> (permalink)
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Reply-To Thomas 'PointedEars' Lahn <cljs@PointedEars.de>
Organization PointedEars Software (PES)
Date Mon, 09 Jan 2012 14:02:37 +0100
User-Agent KNode/4.4.11
Content-Transfer-Encoding 7Bit
Subject Re: Sizing on android phone
Newsgroups comp.lang.javascript
Followup-To comp.lang.javascript
References <N-idnTeX_otixZfSnZ2dnUVZ_rudnZ2d@westnet.com.au> <2320864.tvUHyB9DHY@PointedEars.de> <gPqdneL6M_JaR5fSnZ2dnUVZ_jGdnZ2d@westnet.com.au>
Supersedes <1820649.LCz8dlRQS9@PointedEars.de>
MIME-Version 1.0
Lines 36
NNTP-Posting-Date 09 Jan 2012 14:02:37 CET
NNTP-Posting-Host a3ca8cc5.newsspool2.arcor-online.net
X-Trace DXC=:c04TC7Zi8Fgj[ZPFj7ehOA9EHlD;3YcB4Fo<]lROoRA8kF<OcfhCOK=;L>dWjfmTBDZm8W4\YJNL;?f@h5gMfbLBIlHSWN<J<O@aC04A6RCTN
X-Complaints-To usenet-abuse@arcor.de
Xref x330-a1.tempe.blueboxinc.net comp.lang.javascript:10070

Followups directed to: comp.lang.javascript

Show key headers only | View raw


Andrew Poulos wrote:

> On 9/01/2012 10:15 PM, Thomas 'PointedEars' Lahn wrote:
>> Andrew Poulos wrote:
>>> I've a basic page which, onload, returns the viewport size.
>>>
>>> When I run the page on a Samsung GS it returns 450 x 320.
>>>
>>> [no code, no URL]
> 
> I call this function:
> 
> function getViewPort(win) {
>    win = win || window;
>    if (typeof win.document.clientWidth == "number") {
>      return [win.document.clientWidth, win.document.clientHeight];
>    } else if (win.document.documentElement &&
>               win.document.documentElement.clientHeight) {
>      return [win.document.documentElement.clientWidth,
>              win.document.documentElement.clientHeight];
>    } else {
>      return [win.document.body.clientWidth,
>              win.document.body.clientHeight];
>    }
> }

Obviously, checking the *document*, the *document element* or the *document 
body* will _not_ yield the *viewport* dimensions.


PointedEars
-- 
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
  -- Richard Cornford, cljs, <f806at$ail$1$8300dec7@news.demon.co.uk>

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Sizing on android phone Andrew Poulos <ap_prog@hotmail.com> - 2012-01-09 14:03 +1100
  Re: Sizing on android phone "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2012-01-08 21:23 -0800
  Re: Sizing on android phone Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-01-09 12:15 +0100
    Re: Sizing on android phone Andrew Poulos <ap_prog@hotmail.com> - 2012-01-09 23:17 +1100
      Re: Sizing on android phone Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-01-09 14:02 +0100
        Re: Sizing on android phone "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2012-01-09 11:36 -0800
          Re: Sizing on android phone Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-01-09 22:10 +0100
        Re: Sizing on android phone Andrew Poulos <ap_prog@hotmail.com> - 2012-01-10 06:48 +1100
          Re: Sizing on android phone Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-01-09 22:15 +0100
            Re: Sizing on android phone Andrew Poulos <ap_prog@hotmail.com> - 2012-01-10 08:31 +1100
              Re: Sizing on android phone Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-01-09 23:45 +0100
      Re: Sizing on android phone "Evertjan." <exjxw.hannivoort@interxnl.net> - 2012-01-09 14:23 +0000
  Re: Sizing on android phone "J.R." <groups_jr-1@yahoo.com.br> - 2012-01-12 04:29 -0200
    Re: Sizing on android phone "J.R." <groups_jr-1@yahoo.com.br> - 2012-01-12 06:13 -0200
  Re: Sizing on android phone Arno Welzel <usenet@arnowelzel.de> - 2012-01-12 15:11 +0100
    Re: Sizing on android phone Andrew Poulos <ap_prog@hotmail.com> - 2012-01-13 11:30 +1100
      Re: Sizing on android phone Arno Welzel <usenet@arnowelzel.de> - 2012-01-13 14:52 +0100
  Re: Sizing on android phone Dan <dan@tobias.name> - 2012-01-12 10:11 -0800
    Re: Sizing on android phone Andrew Poulos <ap_prog@hotmail.com> - 2012-01-13 11:41 +1100

csiph-web