$(document).width() gives the proper width when I load the page. But when I refresh in Chome, it includes the width for the scrollbar and I’m not sure why. I’ve tried writing it a couple different ways but it keeps happening. Any ideas?
Not at the current moment. Perhaps is has to do with a couple divs just inside the body with a width of 100%.
Ooooooh, very good idea. That worked.
I’m thinking what happened was the 100% elements was tricking my js to calculating the width before the scrollbars appear.
This made me realize the real issue. I had forgot to wrap my js in $(document).ready() so it was grabbing it before it was loaded (and before the scrollbars existed)
Thanks for the help
EDIT: $(document).ready() didn’t stop the issue, so I guess I use overflow then. Unfavorable, but it’s okay.
Interesting. Definitely keep it inside of doc.ready(), but maybe try using `$(document.body)` to calculate your width?
You must be logged in to reply to this topic.