I am trying to calculate the window width on orientation change for android devices using jquery function $(window).outerWidth(true);
. This calculation gives correct width on orientation change for both iphone
and ipad
but not in android. If i initially load the page in landscape mode or portrait mode i am getting the correct width but once i change the orientation after loading the page i am getting the width for portrait mode as was in landscape mode and vice versa. Please suggest what is happening and how can i handle this issue so that i get the correct window width on orientation change in android device
Javascript – How to get the correct window width on orientation change for android devices both tablets and mobiles
androidgalaxyjavascriptjqueryorientation
Related Topic
- Javascript – Get the size of the screen, current web page and browser window
- Android – How to you get the build/version number of your Android application
- Javascript – Detect viewport orientation, if orientation is Portrait display alert message advising user of instructions
- Android – How to get current time and date in Android
- Android – How to detect orientation change in layout in Android
- Javascript – Get the device width in javascript
- Android – How to Lock Android App’s Orientation to Portrait in Phones and Landscape in Tablets
Best Answer
Why not just use the javascript
screen
object. you should be able to get the screen dimensions with :