I noticed that my scripts were setting widths incorrectly, so I tried the following snippet:
$(window).width() is affected by the margin, border and padding.
These can change as the DOM is being loaded.
As mentioned above, make sure you are waiting until
$(document).ready() before you start looking at / twiddling with the DOM objects.
More info here http://api.jquery.com/width/