Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.teledata-fn.de!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="ISO-8859-1" Message-ID: <1522523.DBZGYLRabQ@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Mon, 09 Jan 2012 23:45:30 +0100 User-Agent: KNode/4.4.11 Content-Transfer-Encoding: 7Bit Subject: Re: Sizing on android phone Newsgroups: comp.lang.javascript References: <2320864.tvUHyB9DHY@PointedEars.de> <20727073.rOyAWzDM7h@PointedEars.de> <1470542.MF3qFTnzmZ@PointedEars.de> Followup-To: comp.lang.javascript MIME-Version: 1.0 Lines: 43 NNTP-Posting-Date: 09 Jan 2012 23:45:31 CET NNTP-Posting-Host: 8b867a72.newsspool2.arcor-online.net X-Trace: DXC=7BWciI_Y<9Lm@jnf X-Complaints-To: usenet-abuse@arcor.de Xref: x330-a1.tempe.blueboxinc.net comp.lang.javascript:10095 Andrew Poulos wrote: > On 10/01/2012 8:15 AM, Thomas 'PointedEars' Lahn wrote: >> Andrew Poulos wrote: >>> Thomas 'PointedEars' Lahn wrote: >>>> Obviously, checking the *document*, the *document element* or the >>>> *document body* will _not_ yield the *viewport* dimensions. >>> With mobile devices, at least the ones I have my hands on, the browsers >>> only open full screen. >> You need to get your hands on more mobile devices or more browsers or >> both. >> >> Regardless, why is it not *obvious* to you that neither of the document >> size, the document element size or the document body size can be >> generally the viewport size? Do you know what a viewport is? > When you put it like that then it doesn't seem likely that I know. > > I based my code on code from the FAQ. Perhaps I misunderstood it. Hmmm. Probably not. That FAQ entry (10.3) *looks* well-researched (I do not have time to review it ATM). Probably my mistake, then. You should try debugging your function so that you can see what branch is taken by the mobile browser (which one?). You could try using window.innerWidth and window.innerHeight although the FAQ entry does not recommend them, and see what values you get. However, there *are* mobile browsers that do not show the document in full screen when it has been loaded. One of those is Dolphin Browser HD 7.2.1 for Android on my HTC Sensation (4G), which has tabs that only disappear if you scroll down. It would be best if you could post the URL or the source code of a reduced testcase. PointedEars -- Anyone who slaps a 'this page is best viewed with Browser X' label on a Web page appears to be yearning for the bad old days, before the Web, when you had very little chance of reading a document written on another computer, another word processor, or another network. -- Tim Berners-Lee