Separating overflows in x and y is only a recent convention before it was not possible to disable scrollbars individually. However, you had several options:
- , .
overflow: hidden, clip:rect(). , .
, :
overflow: hidden.<iframe /> scrolling="no".
`overflow: hidden ' , . , , , .
>
, , , , , . , , , JavaScript, .
overflow: hidden , , overflow: auto, . :
:
[ [ 101px ] + [ 101px ] + [ 101px ] <-- wrapping parent would be 303px ]
, :
CSS
.viewport-clip {
width: 100px;
height: 100px;
overflow: hidden;
}
.viewport {
width: 100px;
height: 130px;
overflow: auto;
overflow-x: auto;
overflow-y: hidden;
}
.horizontal {
width: 303px;
height: 130px;
}
.item {
width: 100px;
float: left;
background: blue;
margin-right: 1px;
height: 100px;
}
:
<div class="viewport-clip">
<div class="viewport">
<div class="horizontal">
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
</div>
</div>
</div>
.viewport-clip . .viewport +30px, OS β . , , , - .
, - .viewport, , JavaScript:
document.getElementById('viewport').scrollLeft = <pixel value here>
, , , , mousewheel, touch device; div. , .
Iframes
- iframe, scrolling="no" . , , iframe.
<iframe src="contents-to-be-scrolled.html" scrolling="no" />
Update
.
http://jsfiddle.net/kdRJ7/