I am working with the orientation in iPad . I am using phone gap for building the application.
I have done following code for orientation change :
function updateOrientation()
{
var orientation=window.orientation;
if ( orientation == 0 ) {
alert("Do Something In Portrait Mode");
}
else if ( orientation == 90 ) {
alert("Do Something In landscape Mode");
}
else if ( orientation == -90 ) {
alert("Do Something In Portrait Mode");
}
else if ( orientation == 180 ) {
alert("Do Something In landscape Mode");
}
}
I am getting the alerts but I don’t know how to resize the window inside this ? Can anybody help me ?I want like following :

Both Safari and Android support a simple orientation change event listener.
And js code :
Source