title: Locking Landscape Device Orientation
body: <p>am developing a phonegap application and have an issue with the device orientation.</p>
  
  <p>Basically I want the user to be free to use the device as he/she wishes to, either portrait or landscape.  However, I only want the screen to turn to Portrait or Landscape.  Currently the screen is also turning reverse landscape.</p>
  
  <p>Is it possible to limit the orientation changes to portrait and landscape only?  (so you would have a total of 2 orientation change possibilities rather than 3).</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I have used a plugin (suggested below) and came up with the below code that works.  Once the screen is rotated to reverseLandscape, it is displayed in landscape mode instead (exactly what I wanted).  However the issue is that if the user turns the mobile in portrait mode, the orientation is locked and would not turn back to portrait. </p>
  
  <pre><code>    $(window).bind('orientationchange', function(event){
  
      if (event.orientation == 'landscape') {
       navigator.screenOrientation.set('landscape');
      } 
      if (event.orientation == 'portrait') {
       navigator.screenOrientation.set('portrait');
      }
  
     });
  </code></pre>
  
  <p>Anyone has any idea where I should put the following line so that it unlocks the orientation?  </p>
  
  <pre><code>navigator.screenOrientation.set('fullSensor');
  </code></pre>