Reputation: 24409
I have a page where the following occurs:
If I resize the browser, everything "snaps" into place where it should be.
I can see 2 solutions which I don't like.
This has to be a fairly common issue. Are there other tricks or suggestions?
Upvotes: 0
Views: 71
Reputation: 337560
You could force the scrollbar to always appear in CSS, or you could set your jQuery code to execute when the page has fully loaded instead of when the DOM is ready, example below:
$(window).bind("load", function() {
// code here
});
This may result in 'jerkiness' as content gets rendered, then is shuffled around as the script configures it for the viewport size.
Personally, I'd just force the scrollbar. Most visitors wouldn't even notice it was there all the time anyway.
Upvotes: 1
Reputation: 8113
KISS method : force the vertical scrollbar to be there.
Forgot to mention, you can also simply use this :
html {overflow-y: scroll;}
Upvotes: 1