WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Templates, Menus & Design => Topic started by: snark on December 16, 2009, 02:14:48 PM

Title: detect the presence of a scrollbar?
Post by: snark on December 16, 2009, 02:14:48 PM
maybe not exactly the right topic but I do not know where to place it

Is it possible to let php detect wether the website has a browser-scrollbar at the rightside

If so I think I can get the website/template stop jumping these tiny bits due to the scrollbar appearing on half of the pages.

 
Title: Re: detect the presence of a scrollbar?
Post by: Luisehahne on December 16, 2009, 03:02:52 PM
Not php but css. But browser handle it in a different way. Google is your friend

Dietmar
Title: Re: detect the presence of a scrollbar?
Post by: Argos on December 19, 2009, 12:24:00 AM
The jumping does not occur in all browsers. IE is clever and reserves space for the scrollbar all the time. Other browsers are not as clever and don't do that, thus creating content to jump when it's longer than the viewport. You can let other browsers behave by adding this line to your stylesheet:
html {overflow-y:scroll;}

No need for scripting!

Title: Re: detect the presence of a scrollbar?
Post by: Luisehahne on December 19, 2009, 01:02:55 AM
Hi,

if you a double scrollbar in IE try this

Code: [Select]
html {overflow: -moz-scrollbars-vertical;} /* Force firefox to always show room for a vertical scrollbar */

Dietmar