WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.6 is now available!


Will it continue with WB? It goes on! | Geht es mit WB weiter? Es geht weiter!
https://forum.websitebaker.org/index.php/topic,32340.msg226702.html#msg226702


The forum email address board@websitebaker.org is working again
https://forum.websitebaker.org/index.php/topic,32358.0.html


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Templates, Menus & Design »
  • detect the presence of a scrollbar?
  • Print
Pages: [1]   Go Down

Author Topic: detect the presence of a scrollbar?  (Read 4172 times)

snark

  • Guest
detect the presence of a scrollbar?
« 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.

 
Logged

Offline Luisehahne

  • WebsiteBaker Org e.V.
  • **
  • Posts: 4548
  • Gender: Male
Re: detect the presence of a scrollbar?
« Reply #1 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
Logged
Note: Once the code has been generated, it is easy to debug. It's not a bug, it's a feature!

Argos

  • Guest
Re: detect the presence of a scrollbar?
« Reply #2 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!

Logged

Offline Luisehahne

  • WebsiteBaker Org e.V.
  • **
  • Posts: 4548
  • Gender: Male
Re: detect the presence of a scrollbar?
« Reply #3 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
Logged
Note: Once the code has been generated, it is easy to debug. It's not a bug, it's a feature!

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Templates, Menus & Design »
  • detect the presence of a scrollbar?
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2