Reputation: 7956
$("#btnGall").click(function() {
$('#home,#vid,#story,#con').hide();
$('#gall').slideDown('slow');
});
After the first line the screen is almost empty and scrollbar disappears, moving the rest of the page to the right.
After the second line - scrollbar reappears, and again shift whole of the page.
How to prevent this ?
Upvotes: 2
Views: 294
Reputation: 41665
You can apply overflow-y
to html.
html { overflow-y: scroll }
If I recall, applying that to body will cause double scrollbars on IE.
Edit: Here's a sample.
Upvotes: 2