Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: "J.R." Newsgroups: comp.infosystems.www.authoring.html,comp.lang.javascript Subject: Re: Sizing on android phone Date: Thu, 12 Jan 2012 06:13:23 -0200 Organization: Aioe.org NNTP Server Lines: 51 Message-ID: References: NNTP-Posting-Host: edb3lPNLwDIT/BKKc/Xuzw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:8.0) Gecko/20111105 Thunderbird/8.0 X-Antivirus-Status: Clean X-Notice: Filtered by postfilter v. 0.8.2 X-Antivirus: avast! (VPS 120111-1, 01/11/2012), Outbound message Xref: x330-a1.tempe.blueboxinc.net comp.infosystems.www.authoring.html:1872 comp.lang.javascript:10160 On 12/01/2012 04:29, J.R. wrote: > On 09/01/2012 01:03, 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. >> >> When I create a small elearning course designed to run at 450 x 320 the >> course ends up occupying just the top quarter of the screen. (Because of >> the required user interaction I've had to disallow the default actions >> for swipes but not gestures.) If the course queries the viewport size it >> returns 1125 x 800. > > There is a good explanation on measuring the viewport dimensions of a > mobile device browser at: > There is an even better article at: > > Basically use (in strict mode): > document.documentElement.offsetWidth / offsetHeight > Sorry, but the correct code for retrieving the layout viewport dimensions in strict mode (W3C standard compliant mode) is: document.documentElement.clientWidth / clientHeight David Mark also wrote a good primer on measuring the viewport dimensions of desktop browsers:: >> >> To get it to "fill" the screen I added >> >> to the head. >> >> My questions are >> - I don't understand why the viewport size changes between my basic page >> and the course on the same device. > > Maybe because of the css in use, invalid html+xml markup, and/or the JS > code used to retrieve the viewport dimensions. > >> - Will be supported on Windows phones? > > I'll pass on this one. > -- Joao Rodrigues (J.R.)