0

i'm working on a web app which has layout constraints set by javascript, it mainly works around calculations on the window.innerHeight but i get a bad value only on my iphone4 with iOS7.

this is a sample screenshot (as you can see at the bottom, the text is cut): enter image description here

what i get is a window.innerHeight of 568px instead of 480px and this is breaking my layout.

enter image description here

anyone encountered any error like this?

i've my viewport set like this:

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui" />

any help is GREATLY appreciated. thanks :)

valerio0999
  • 11,458
  • 7
  • 28
  • 56
  • Are you using safari? If this is the case, you need to add around 30px due to the top safari bar, however have you tried to use document,height??? – Romain Jun 19 '14 at 10:39
  • it's not a matter of adding, but subtracting. i have an extra 88px calculated by javascript that i don't need and that are incorrect (iphone4 window height is 480px). i tried document height, still 568px instead of 480px – valerio0999 Jun 19 '14 at 10:47
  • Your are right, you need to subtract it. However, 568px is the landscape width of an iphone 5. http://bugs.jquery.com/ticket/6724 – Romain Jun 19 '14 at 11:07
  • Maybe this can help: http://stackoverflow.com/questions/18855642/ios-7-css-html-height-100-692px – Romain Jun 19 '14 at 11:08
  • sorry that didn't help :\ – valerio0999 Jun 19 '14 at 11:41

0 Answers0