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


Groups > comp.lang.javascript > #16964

Re: Confused about window size

Date 2012-10-30 20:44 +1100
From Andrew Poulos <ap_prog@hotmail.com>
Newsgroups comp.lang.javascript
Subject Re: Confused about window size
References <-LOdnYNMXsgG5hLNnZ2dnUVZ_g-dnZ2d@westnet.com.au> <XnsA0FC5B5916FA2eejj99@194.109.133.133>
Message-ID <NsSdnXbM-rUcPBLNnZ2dnUVZ_oidnZ2d@westnet.com.au> (permalink)

Show all headers | View raw


On 30/10/2012 6:58 PM, Evertjan. wrote:
> Andrew Poulos wrote on 30 okt 2012 in comp.lang.javascript:
>
>> A Samsung's Galaxy S2 screen's size is
>>     480 x 800.
>>
>> When I put an some code in a page and it returned that the window size
> is
>>     240 x 320
>
> I take it that you are talking of an unspecified browser [default, chrome
> mobile, dolphin, opera mobile, skyfire, etc], as implemented on your
> [specified] specific android platform, used in an unspecified screen-mode
> [portrait or landscape] and reported in an unspecified unit [px, mm, inch,
> etc]?
>
> Can you specify the unspecified?

I'm considering using appMobi
<http://www.appmobi.com/>
to create an android app of some HTML5 I'm writing. I'd like to know the 
window size before I start designing in earnest.

> Does such [supposed] browser have a header?

> Are you using javascript? If so what is your code?

The entire test page is

<!DOCTYPE html>
<html>
<head>
<title>Size</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">

<script type="text/javascript" charset="utf-8" 
src="http://localhost:58888/_appMobi/appmobi.js"></script>

<script type="text/javascript">
function onDeviceReady() {
   AppMobi.device.hideSplashScreen();
   AppMobi.device.setRotateOrientation("landscape");


   var str, size = [];
   if (typeof window.document.clientWidth == "number") {
     size = [window.document.clientWidth, window.document.clientHeight];
   } else if (window.document.documentElement &&
     window.document.documentElement.clientHeight) {
     size = [window.document.documentElement.clientWidth,
             window.document.documentElement.clientHeight];
   } else {
     size = [window.document.body.clientWidth,
             window.document.body.clientHeight];
   }
	
str = "Window width is " + size[0] + " pixels," +
       " and the height is " + size[1] + " pixels";
document.getElementById("sizer").firstChild.nodeValue = str;
}
document.addEventListener("AppMobi.device.ready",onDeviceReady,false);
</script>

</head>
<body>
<h2 id="sizer" style="text-align:center;">&nbsp;</h2>
</body>
</html>

>> Why the change in proportion? The 240 I can sort of understand but why
>> isn't reported as
>>     240 x 400
>> ?
>
> Perhaps you should indulge us then by making and specifying a web-page for
> testing!
>
> I think you take it out of proportion, the present landscape of mobile
> cyberworld is full of bizarre portraits.

Andrew Poulos

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


Thread

Confused about window size Andrew Poulos <ap_prog@hotmail.com> - 2012-10-30 18:02 +1100
  Re: Confused about window size "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-10-30 08:58 +0100
    Re: Confused about window size Andrew Poulos <ap_prog@hotmail.com> - 2012-10-30 20:44 +1100
      Re: Confused about window size "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-10-30 16:57 +0100
        Re: Confused about window size Andrew Poulos <ap_prog@hotmail.com> - 2012-10-31 10:29 +1100
          Re: Confused about window size "J.R." <groups_jr-1@yahoo.com.br> - 2012-10-31 22:09 -0300
            Re: Confused about window size "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-11-01 18:14 +0100
  Re: Confused about window size David Mark <dmark.cinsoft@gmail.com> - 2012-10-30 01:39 -0700

csiph-web