Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Testing/mocking an orientation change in Chrome?

We're writing a mobile app using jQuery mobile and do most of the javascript debugging in Chrome. One thing I can't test however is an orientation change, from portrait to landscape and vice versa. I have to use a phone to fire that event, and am unable to debug the javascript window.orientationchange event without Chrome.

Or so it would seem. Is there a way to mock this event in Chrome somehow?

like image 507
larryq Avatar asked Oct 24 '12 14:10

larryq


People also ask

How do I change my browser orientation?

Select the Start button, then type settings. Select Settings > System > Display, and choose a screen orientation from the drop-down list next to Display orientation.


1 Answers

Since a desktop device doesn't have any real orientation changes, like mobile devices does have, it's no use to listen to orientationchange. You could simulate orientation by resizing the browser window though.

David Walsh wrote an article about this: http://davidwalsh.name/orientation-change

like image 178
AntonNiklasson Avatar answered Oct 20 '22 04:10

AntonNiklasson