You want to get the width and height of the window and document in pixels.
jQuerys width and height methods provide easy access to the basic dimensions of the window or document:
$(function() {
alert('Window height:'+jQuery(window).height()); // returns the height of the viewport
alert('Window width:'+jQuery(window).width()); // returns the width of the viewport
alert('Document height:'+jQuery(document).height()); // returns the height of the document
alert('Document width:'+jQuery(document).width()); // returns the width of the document
});
0 Comment(s)