Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6917155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:41:40+00:00 2026-05-27T09:41:40+00:00

I am working on a mobile app and I need to get the correct

  • 0

I am working on a mobile app and I need to get the correct browser inner height for it.

I am currently using

$(window).height()

to calculate the height. this works fine on the iphone/ipad

When I booted up a
Galaxy S2 running android 2.3.5

I started to get some strange results…

The first time the page loads and $(window).height() is called on

$().ready(function(){...

I get the correct results (regardless of the phone being vertical or horizontal)

As soon as I rotate the phone into a horizontal position it reports back the correct height

the issue happens when rotating the phone from horizontal to vertical

The Phone reports back a completely incorrect height value

Now I tried using these values to see if any of the values were correct

screen.height   
screen.availHeight  

but still the same results


I am using this method to detect rotation

    var previousOrientation = 0;
var checkOrientation = function(){
    if(window.orientation !== previousOrientation){
        previousOrientation = window.orientation;
        // orientation changed, do your magic here
    }
};

window.addEventListener("resize", checkOrientation, false);
window.addEventListener("orientationchange", checkOrientation, false);

// (optional) Android doesn't always fire orientationChange on 180 degree turns
setInterval(checkOrientation, 2000);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T09:41:41+00:00Added an answer on May 27, 2026 at 9:41 am

    Screen size and innerHeight in the Android browser is really f.u.b.a.r. Especially in combination with a bug that sometimes cause the WebView not to resize when closing the keyboard.
    The most sane property I’ve found for Android is window.outerHeight. On Android it usually reports screen height minus status bar height. Doesn’t do the same on iOS though, so you might need to do some browser sniffing ;(

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently working on a mobile app that is going to communicate with
I am working on an iPhone mobile web app using jqtouch to make it
I'm diving into writing a mobile app with jQuery Mobile/PhoneGap. I'm using this sample
I'm working with C#.net developing applications for windows mobile 6, and i need get
i'm working on windows mobile app (c#, .net 2.0). i would like to make
I'm working on a mobile web app, and in my page I have a
I am working on a mobile web app and am trying to remove the
I have been working on a Windows Mobile app for a little while now
I am working on a jQuery Mobile App. On one of the pages I
I am working with sencha to build mobile app. I have created one page

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.