How to find the screen width and height

2 777 vues
Accéder directement au premier message non lu

Raju

non lue,
12 mai 2011, 08:06:3112/05/2011
à 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

non lue,
12 mai 2011, 10:38:5212/05/2011
à 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

non lue,
15 mai 2011, 04:26:2315/05/2011
à phonegap

normally use window.innerHeight or document.body.clientHeight

but on the Blackberry only screen.height works ( Webworks 6.x
platform )
Répondre à tous
Répondre à l'auteur
Transférer
0 nouveau message