i want to create a grey out as that of gmail when we try to upload an exe. the grey out screen should cover the whole screen even the scrollbars, the scrollbars should be visible through it but disabled how this can be achieved using javascript and css please dont tell me to set the overflow of body to hidden.
-
possible duplicate of [Prevent scrolling when videobox is on](http://stackoverflow.com/questions/3120712/prevent-scrolling-when-videobox-is-on) – Marcel Korpel Jul 13 '10 at 12:45
3 Answers
It only works if you wrap your whole page inside a div and set this div to allow scrolling but disallow the body from scrolling (or use iframes).
In gmail, the body has overflow:hidden
. The scrollbars you see belong to an iframe
with id canvas_frame
.

- 191,379
- 34
- 261
- 317
Did you try looking at the gmail page, with a tool like Firebug, when it's greyed out this way ?
It'll allow you to see exactly how they do it ;-)
Apparently, after a quick look, it seems they're using a <div>
such as this one :
<div class="Kj-JD-Jh" style="opacity: 0.5; width: 1560px; height: 366px;"></div>
The interesting thing here is that this 1560px
is bigger than the visible area of my screen : it includes the right scroll bar.

- 395,085
- 80
- 655
- 663
Top level Scrollbars are browser components and not part of the canvas. Thus it is not possible to grey them out. You can only grey out scrollbars that are part of the HTML view.
Otherwise see this