title: Detect orientation change before event firing with phonegap
body: <p>I'm developing an application for Android, iOS and Windows Phone with PhoneGap.
  I have a page with a graph and I would like to display it in fullscreen if the user rotates the device in landscape orientation.</p>
  
  <p>The problem is that the whole application must be blocked on portrait orientation, so the landscape must be available only on this graph page.</p>
  
  <p>I have 2 possibilities :</p>
  
  <hr>
  
  <p>1) Authorize portrait/landscape orientation in the whole application.
  If user is on any other page than graph and if he puts device in landscape orientation, cancel the rotation and stay in portrait mode.</p>
  
  <p>I think I must have a way to catch an event before these one :</p>
  
  <pre><code>window.addEventListener("orientationchange", orientationChange, false);
  window.addEventListener("resize", resize, false);
  </code></pre>
  
  <hr>
  
  <p>2) Block the whole application in portrait orientation.
  If user is on graph page, add a button which allow to rotate this page in landscape just to display the graph, and return to portrait mode after that.</p>
  
  <p>I found this but only useful for Android : <a href="https://github.com/their/pg-plugin-screen-orientation" rel="nofollow">set screen orientation</a></p>
  
  <hr>
  
  <p>So, is there a way to do one of these possibilities ?</p>
  
  <p>Thanks</p>