This is a migrated thread and some comments may be shown as answers.

onchangeorientation event not fired

1 Answer 45 Views
General Discussion
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Relez
Top achievements
Rank 1
Relez asked on 05 Mar 2014, 05:57 PM
Hello there, I am developing a Kendo UI Mobile app using the AB windows client, there are some views I need to catch the orientationchange event to do something I need for. I have this line in onDeviceReady event:

document.addEventListener("orientationchange", onOrientationChange, true);

Then I have the onOrientationChange function:

function onOrientationChange(e) {
//do something...
}


In the AB Simulator the event is fired but on the device nothing happens. For testing I am using a Samsung Galaxy S3 with Android 4.3, the cordova version is 3.2.0.

Any help please?

Thanks!

1 Answer, 1 is accepted

Sort by
0
Relez
Top achievements
Rank 1
answered on 05 Mar 2014, 08:12 PM
Hello, I figured out the problem, I was writing:

document.addEventListener("orientationchange", onOrientationChange, true);

insted of:

window.addEventListener("orientationchange", onOrientationChange, true);

Thanks!
Tags
General Discussion
Asked by
Relez
Top achievements
Rank 1
Answers by
Relez
Top achievements
Rank 1
Share this question
or