js detect window ratio code example
Example 1: get window resolution javascript
var clientWidth = document.documentElement.clientWidth;
$("h2").text(clientWidth);
Example 2: js know size of screen
alert("Your screen resolution is: " + screen.width + "x" + screen.height)