Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

hiding scrollbars shifts page to right by 20px



6:43 am on Feb 13, 2008 (gmt 0)

10+ Year Member

This is lil urgent..
I am hiding the scrollbars using document.documentElement.style.overflow = "auto";
But No. 1. the page shifts to right by 20px with the jerk once the scrollbars are disabled. 2. after enabling again it shifts to left again by 20px with the jerk also gives the horizontal scrollbar in IE.
::How to get rid of this 20px shift to right and horizontal scrollbar in IE…

Thanks in advance - Vicky


11:04 am on Feb 13, 2008 (gmt 0)

10+ Year Member

or is there a way i can gray out the scroll bar. The scroll bar should not hide it should just stop working but visually be there.. can we do it?


2:46 pm on Feb 15, 2008 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member

Vicky - the scrollbar becoming grey and non-functional is the default behaviour.

Also, setting the overflow property in the CSS will stop the page jumping after the JS kicks in.

If you must do it by JS then add a body margin at the same time to balance the page and stop it jumping, I believe in IE it's actually 14px.


Featured Threads

Hot Threads This Week

Hot Threads This Month