- Get height of window
$(window).height(): Returns height of visible viewport/screen (does not include height of scrollable content) - Get height of the page
$(document).height(): Returns height of the length of the content/page (includes the height of the scrollable content) - Get width of window
$(window).width(): Returns width of visible viewport minus width of scrollbar (which is 17px for most of the browser except mobile versions and Edge) - Get width of the page
$(document).width(): Returns width of visible viewport minus width of scrollbar (which is 17px for most of the browser except mobile versions and Edge)
Good luck calculating height and width w.r.t. the screen or page.