Orientation events do not work for the iPhone and iPad simulator
The orientation events do not work for the iPhone and iPad simulators. Using this code shows that they do not exist.
if (window.DeviceOrientationEvent) {
console.log("DeviceOrientation is supported"); } else if
(window.OrientationEvent) { console.log("MozOrientation is
supported"); }
window.DeviceOrientationEvent is supported in Chrome. Is there a configuration option that must be changed or is this event not supported at this time? If it is not supported, when will it be supported and how can I get an update?
Thank you.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Shaun Sullivan on 02 Oct, 2012 05:32 PM
We are actually firing the event, but it appears there is an issue with the window.DeviceOrientationEvent test.
This code will work (e.g. the event will be fired):
window.onorientationchange = function() {
};
2 Posted by Davin McCoud on 02 Oct, 2012 06:37 PM
Thank you. That worked great.
We tried this
but it did not work. What you suggested does work.
Thank you.
3 Posted by Davin McCloud on 02 Oct, 2012 06:40 PM
Thank you. That worked great.
We tried this
window.addEventListener("orientationchange", SCADALynxMobile.onOrientationChanged, false);
but it did not work. What you suggested does work.
Thank you.
> From: [email blocked]
> To: [email blocked]
> Date: Tue, 2 Oct 2012 13:32:22 -0400
> Subject: Re: Orientation events do not work for the iPhone and iPad simulator [Electric Mobile Studio - Problems #78]
>