Resize and offset when orientation changes.

Sometimes the resize event does not get triggered, such as in phonegap apps.