$("#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 ?
You can apply
overflow-yto html.If I recall, applying that to body will cause double scrollbars on IE.
Edit: Here’s a sample.