How to find the screen width and height

2,777 views
Skip to first unread message

Raju

unread,
May 12, 2011, 8:06:31 AM5/12/11
to phonegap
Hi friends,

I am developing a app for samsung galaxy tab using phonegap. But when
ever I am loading same app in the other mobile like Blackberry the
alignment is changing. I would like to fix this problem by finding the
device width and height dynamically. Can any one of you please guide
me How can I find the device height and width then according to I can
fix the width and height in my app.

Thanks in advance
Bharath

Horst

unread,
May 12, 2011, 10:38:52 AM5/12/11
to phonegap
Hi Bharath,

maybe window.innerHeight and window.innerWidth is what you search.
Maybe you also should have a look on window.devicePixelRatio

best regards
Horst

Pete

unread,
May 15, 2011, 4:26:23 AM5/15/11
to phonegap

normally use window.innerHeight or document.body.clientHeight

but on the Blackberry only screen.height works ( Webworks 6.x
platform )
Reply all
Reply to author
Forward
0 new messages