SOMETIMES when I call:
$(window).width();
the wrong value is incorrect (in all browsers except IE, in IE this is always correct). I use the line:
$('div.container p').text($(window).width());
to change the text of the p element so that I can see what value was returned when the window was resized. Here is an example when the return value is incorrect: 
In the upper right corner you can see what actual sizes are in Chrome.
I noticed that WHEN the value is incorrect, it is always turned off by 17 pixels.
NOTE that the return value is NOT always erroneous, so in most cases the window looks as it should.
Help!
source share