when calling $(document).width(); inside $(window).load(function(){}) or $(document).ready(function(){}) I get a different result to when I’m calling it from inside $(window).resize(function(){})
the value is about 100px off so it’s not because I am resizing the window, any ideas why this is happening?
EDIT:
Browser: Firefox 8.0.1
when calling $(document).width(); inside $(window).load(function(){}) or $(document).ready(function(){}) I get a different result to when
Share
I found the reason for it: I have a div inside the document that has left set to 50%. that stretches the document width. once I resize it I set left to a different value, hence decreasing the document width to the browser width – basically what Baszz was saying in his first comment