Forums

Give help. Get help.

  • # November 21, 2012 at 5:52 pm

    $(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?

    # November 21, 2012 at 6:27 pm

    Not at the current moment. Perhaps is has to do with a couple divs just inside the body with a width of 100%.

    # November 21, 2012 at 7:51 pm

    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.

    # November 21, 2012 at 8:11 pm

    Interesting. Definitely keep it inside of doc.ready(), but maybe try using `$(document.body)` to calculate your width?

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

icon-anchoricon-closeicon-emailicon-linkicon-logo-staricon-menuicon-nav-guideicon-searchicon-staricon-tag