Working your magic with Firefox OS – Listen to orientation change

5 Aug 2013
22 May 2020
< 1 minutes

One of the things I tried to do in the Firefox OS application I’m building is to manage the screen orientation. I want my application to know when the user changed the orientation of the phone, so I can take action accordingly. To do this, you need to listen to onmozorientationchange, and once it’s called, you are able to know which orientation the phone is now: portrait-primary, portrait-secondary, landscape-primary, and landscape-secondary.

It’s now time for you to add this feature to your application.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.