I’ve noticed on facebook, when viewing an image that is larger than the height of your browser window, it will alter the scrollbar of the entire page, so that scrolling up and down will reveal the parts of the image you’re missing.
Having not been formally trained in the art of JavaScript/CSS, maybe I missed the lesson where I was supposed to learn how obvious the answer to this question is. Regardless, I thought I’d ask and see if you guys could help me understand how to override the browser’s default scrollbar behavior.
Figured out what I was going for…
To use the facebook image viewer theater as an example, when you click to view an image, it will set body’s
overflowtohidden. At the same time, they will fade in their theater div, whose properties are something along the lines of:That way, if the image is taller than the viewing size of the browser window, it will place the div’s scroll bar in the position where the body’s scroll bar would go.
Again, maybe this is obvious for all of you. I’m still learning these tricks as I go.