9

I need to calculate the visible screen height on ios8. Means when the keyboard is open, calculate the screen height minus the keyboard height. minus the status bar, etc.

help?

Megi Ben Nun
  • 405
  • 3
  • 6
  • 20
  • Have you tried this: http://stackoverflow.com/questions/3437786/get-the-size-of-the-screen-current-web-page-and-browser-window ? – Alex Nov 06 '14 at 12:10
  • I want to get the height of the page i can see. what ever is invisible by the keyboard / status bar / another IOS menu - I don't want the height to be included on this height. – Megi Ben Nun Nov 06 '14 at 13:52
  • On other IOS, I use the (window.innerHeight) - (window.scrollTop_before_keybvoard_open - window.scrollTop_after_keybvoard_open) . IOS8 for somereason scrolling the page every time differently... so I cannot rely on this anymore. – Megi Ben Nun Nov 06 '14 at 13:55
  • I see... Do you know if CSS vw and vh measurements change when the keyboard is up? As in, if you open the keyboard does the vw and vh become smaller reflecting the screen change? If so you could add a new element to the document with sizes 100vw and 100vh and the check to see how many pixels it's size correspond to. – Alex Nov 06 '14 at 18:10
  • vh not changed when the keyboard is open. :( – Megi Ben Nun Nov 10 '14 at 10:18

1 Answers1

0

maybe the document.documentElement.clientHeight is changed.

Sunil Garg
  • 14,608
  • 25
  • 132
  • 189
yoyo
  • 1
  • 1