onchangeorientation event not fired

2 posts, 0 answers
  1. Relez
    Relez avatar
    45 posts
    Member since:
    Jan 2013

    Posted 05 Mar 2014 Link to this post

    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!
  2. Relez
    Relez avatar
    45 posts
    Member since:
    Jan 2013

    Posted 05 Mar 2014 in reply to Relez Link to this post

    Hello, I figured out the problem, I was writing:

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

    insted of:

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

    Thanks!
Back to Top