What is the major difference between $(window).width() vs $(document).width() in jQuery?
Whether window denotes the browser and document represents
$(window).width(); returns the width of browser viewport
$(document).width(); returns width of HTML document
$(document).width() is a bit unreliable, resulting in a lower value for a full-screened browser . $(window).width() is safer.
$(window).width() gets the entire width of the window, including things like the scroll bar .