X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=bluechips%2Fpublic%2Fjs%2Fmobile.js;h=44090eef895342e21dc227d57ddf060ba448ddd3;hb=38a1e5ac1c493e637c4466afd19f3cf844af7592;hp=a7ab3266d5d65627dd1cde160039b0d1a1009e55;hpb=2bbd626ed9da8fd98e6004c91151c67efc97854b;p=bluechips.git diff --git a/bluechips/public/js/mobile.js b/bluechips/public/js/mobile.js index a7ab326..44090ee 100644 --- a/bluechips/public/js/mobile.js +++ b/bluechips/public/js/mobile.js @@ -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"); });