load page with inactive scrollbar
I have a page that scrolls through images, some taller than the others. When a tall image loads it auto开发者_如何学Python-creates a scrollbar in the browser window, causing a width jerk. Is there a way to load a scroll bar regardless of if it is needed, and when a tall image apears it activates itself accordingly, then deactivates its self accordingly when the image changes to a shorter image?
Thank you!
div {
overflow: scroll;
}
ought to do it. That will put up scrollbars whether or not they are called for. You can get fancier by doing
div {
overflow-x: scroll;
}
if you just want horizontal scrollbars or
div {
overflow-y: scroll;
}
if you just want vertical scrollbars. From your question it sounds like you are interested in the latter solution.
Make a container div for the images, then make its height:110%;
or any height > 100%.
精彩评论