I am capturing the orientationchange
event like this:
$(window).bind( 'orientationchange', function(e){
});
How can I get the new screen width and height in pixels after the orientationchage
?
I have tried screen.width
but this doesn't change, it remains as the initial width, even after orientation change.
If you are using the meta tag viewport you could also update that tag (with jquery example:)
Also you can use
screen.availWidth
. It gets changed with orientation.Use $(window).resize, it runs after orientationchange