Get window size in Jquery

This fiddle is helpful in getting the window resolutions for responsive web designs

by Tapan kumar

HTML

<div id="divInitial"></div>
<div id="divResize"></div>

JavaScript

$("#divInitial").text("Initial Window width: " + $(window).width() + ", height: " + $(window).height() + ".");

//Event to handle resizing
$(window).resize(function () {
    var width = $(window).width();
    var height = $(window).height();
    //alert("width:"+ width + " and height:"+ height);
    $("#divResize").text("Window width: " + width + ", height: " + height + ".");
});