0

I'm using Bootstrap Markdown on my site. In the demo here, when I enter fullscreen, my browser's scrollbar (Firefox) disappears. However, on my site this does not happen (the scrollbar sticks around). I am wondering how exactly the demo is accomplishing this.

Siguza
  • 21,155
  • 6
  • 52
  • 89
Franz Kafka
  • 780
  • 2
  • 13
  • 34

1 Answers1

0

I'm assume this is part of your browsers settings but if you want to accomplish it with javascript it is actually very simple

//Check for fullscreen
if ((window.fullScreen) || (window.innerWidth == screen.width && window.innerHeight == screen.height)){
    document.body.style.overflowY = "hidden"
} else {
    document.body.style.overflowY = "auto";
}

I used this Checking if browser is in fullscreen post to figure out how to determine if the window was fullscreen so you can refer to that for further information on that.

Community
  • 1
  • 1
itotallyrock
  • 21
  • 2
  • 7