"deviceorientation" in Firefox?

I work with "deviceorientation" on my laptop, and the jsfiddle example seems to work fine in Chrome, but Fire Fox doesn't respond to it. I think line 15 of JS is not working somehow ...

window.addEventListener('deviceorientation', devOrientHandler, false);

The MozOrientation version on line 18 doesn’t seem to raise the slack

window.addEventListener('MozOrientation', mozDevOrientHandler, false);

Just updated Firefox. And no change. I tried to test on the desktop and (not surprisingly) that the machine does not have the necessary accelerometers / sensors, so the violin does not work on any browser on this computer. I was looking through questions reading the w3c specifications, MDN support , and I still can't get it.

Does anyone know if this is a problem with Firefox? Have I really messed up the settings or something else? Any help is much appreciated. Any ideas as to why this jsfiddle example does not work in Firefox? Note: the green ball example in the MDN link above also does not work on FF. The first time we ask a question about SO.

Thank!

Edit: I have to clarify that jsfiddle is the best example I could find and is NOT my code. I believe this was from HTML5rocks.com, but I cannot find this source.

+1
source share
1 answer

Firefox DeviceOrientation Desktop. Firefox , API Desktop.

, DeviceOrientation . DeviceOrientation Mac OS X - , Apple. , event.alpha undefined - , .

, , API. (Safari on iOS, Chrome/Opera/Firefox Android) , window.addEventListener('deviceorientation', function(event) { /* ... */ }, false).

+1

All Articles