RsD0p9BK
4/29/2014 - 8:04 AM

http://www.substanceofcode.com/2010/08/13/check-screen-orientation-with-jquery-in-w3c-widget/

$(window).resize( function(){
    var height = $(window).height();
    var width = $(window).width();

    if(width>height) {
      // Landscape
      $("#mode").text("LANDSCAPE");
    } else {
      // Portrait
      $("#mode").text("PORTRAIT");
    }
});