$(window).width() refers to the width of the device's viewport.
$(document).width() refers to the width of the html content
When a browser window is reduced until the document content overflows the window, the values of $(window).width() and $(document).width() starts to diverge.
Also, on an iPhone 6, the $(window).width() is always 667, while the $(document).width() is the actual width of the HTML content. The HTML document pixels are "zoomed" to fit inside the iPhone 667 pixels (not sure what this means ?).
$(window).width() refers to the width of the device's viewport. $(document).width() refers to the width of the html content
When a browser window is reduced until the document content overflows the window, the values of $(window).width() and $(document).width() starts to diverge.
Also, on an iPhone 6, the $(window).width() is always 667, while the $(document).width() is the actual width of the HTML content. The HTML document pixels are "zoomed" to fit inside the iPhone 667 pixels (not sure what this means ?).