]> asedeno.scripts.mit.edu Git - bluechips.git/blobdiff - bluechips/public/js/mobile.js
added orientation changing interface
[bluechips.git] / bluechips / public / js / mobile.js
index a7ab3266d5d65627dd1cde160039b0d1a1009e55..44090eef895342e21dc227d57ddf060ba448ddd3 100644 (file)
@@ -24,6 +24,20 @@ $(function() {
     });
     $('#tabs a.selected').click();
 
+    $('body').bind('orientationchange', function() {
+        switch(window.orientation) {
+            case 0:
+            case 180:
+                $('body').attr('id', 'portrait');
+                break;
+            case -90:
+            case 90:
+                $('body').attr('id', 'landscape');
+                break;
+        }
+    });
+    $('body').trigger('orientationchange');
+
     console.log("ready() done");
 });