title: Can js/jQuery determine the orientation of the iPhone?
body: <p>Out of curiosity I've been playing with jQuery to determine the browser's screen size, and it occurred to me that screen size could be used to determine whether or not a visitor was using an iPhone/iTouch to view the site.</p>
  
  <p>So I used the following to test this:</p>
  
  <pre><code>$(document).ready(
  
      function() {
  
          var screenX = screen.width,
              screenY = screen.height;
  
          alert("X: " + screenX + " Y: " + screenY);
  
          if (screenX == 320 &amp;&amp; screenY == 396) {
              $('div#wrap').css('background-color','#f00');
          }
  
          else if (screenY == 320 &amp;&amp; screenX == 396) {
              $('div#wrap').css('background-color','#0f0');
          }
      }
  );
  </code></pre>
  
  <p>On viewing the page via iPhone, I notice that the dimensions are consistently (regardless of orientation):</p>
  
  <p>x: 320, y: 396</p>
  
  <p>This is regardless of orientation. I haven't, as yet, attempted to use an <code>onChange</code> event to detect changes (mainly because I'm still so new at jQuery), but I wondered if there was a way to determine, via jQuery or plain javascript, the iPhone/iTouch's orientation?</p>