We blog on many topics around Typo3 and Java / J2EE

To visualize the information of the screen a feature was implemented to show the current height, width and orientation (portrait or landscape) of the screen below the actual Logo area.

HTML

<body>
  <footer>
    <div>
      <p><span id="dimensions"></span></p>
    </div>
  </footer>
</body>

JQuery

$(document).ready(function() {
   getWindowDimensions();
}

$(window).resize( function(){
   getWindowDimensions();
});

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

    if (width > height) {
        // Landscape
        $("#dimensions").text("H" + height + "W" + width + "L");
    } else {
        // Portrait
        $("#dimensions").text("H" + height + "W" + width + "P");
    }
}

Archive

2016 (5)

May (4)

January (1)

2015 (2)

November (1)

May (1)

2014 (1)

April (1)

2012 (3)

May (3)