When a CSS rule is set like this
html { overflow: hidden; }
I can't get or set scroll position in Chrome using javascript anymore (only DOMElement.scrollIntoView
is working).
When I remove it it works but it messes up the whole page containing a "parallax effect" created with CSS3. Here is a reduced example (only prefixed with -webkit-): http://jsfiddle.net/BaliBalo/LxCxn/
hidden - The overflow is clipped, and the rest of the content will be invisible. scroll - The overflow is clipped, and a scrollbar is added to see the rest of the content.
Use overflow-x : scroll and overflow-y : hidden , or overflow: scroll hidden instead. Use overflow-x : hidden and overflow-y : scroll , or overflow: hidden scroll instead.
hidden. The opposite of the default visible is hidden. This literally hides any content that extends beyond the box. This is particularly useful in use with dynamic content and the possibility of an overflow causing serious layout problems.
To prevent scrolling with this property, just apply the rule overflow: hidden to the body (for the entire page) or a container element. This hides all content beyond the element's border.
You can do by using the clearfix to do "layout preversing" the same way overflow: hidden does.
.clearfix:before,
.clearfix:after {
content: ".";
display: block;
height: 0;
overflow: hidden;
}
.clearfix:after {clear: both;}
.clearfix {zoom: 1;} /* IE < 8 */
add class="clearfix" class to the parent, and remove overflow: hidden;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With