title: window.orientation returns different values in iOS and Android
body: <p>I am testing my Web Application on <strong>iPad</strong> <em>(Safari browser)</em> and <strong>Samsung Tab 2</strong> <em>(Default browser)</em>. The <em>window.orientationchange</em> returns different values in both the devices.</p>
  
  <pre><code>$(document).ready(function() {
              window.addEventListener("orientationchange", centerLoginBox);
              window.addEventListener("load", centerLoginBox);
          });
  
          function centerLoginBox() {
              if (window.orientation == 90 || window.orientation == -90) { //Landscape Mode
                  $('#loginbox').css('margin-top', '20%');
                  alert(window.orientation);
              }
              else if (window.orientation == 0 || window.orientation == 180) { //Portrait Mode
                  $('#loginbox').css('margin-top', '40%');
                  alert(window.orientation);
              }
  </code></pre>
  
  <p>In Tab 2 the alert throws '0' and '180' for <em>landscape</em> mode and the values '90' and '-90' for <em>portrait</em> mode(<strong>just the opposite behavior in iPad</strong>).</p>
  
  <p>Is this some kind of design difference in iOS and Android? What could be a common solution for this issue?</p>