Working your magic with Firefox OS – Listen to orientation change

5 Aug 2013
22 May 2020
< 1 minute
FFxOS_Devs_twitterHeader_1252x626_1

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.

The reCAPTCHA verification period has expired. Please reload the page.