Reputation: 101
Is it possible to scroll vertically a div without using scrollbar instead using only mousewheel up and down for scroll ?
I have a instance like ,
<div style="height:200px">
<div class="samplediv" style="overflow:scroll;overflow-y:hidden;height:1000px">
.
.
.
.
</div>
</div>
such that bigger div lies inside the smaller div , i want to scroll up as well as down the inner div , but i wanna hide my vertical scroll , is that possible in anyway , i tried with event hooks for scroll , but event is not hooked.
Upvotes: 5
Views: 5471
Reputation: 9414
Please don't do this! It will make the interface unusable because no one will no where the can scroll!
But if you must...
CSS
#wrapper {
width: 150px;
overflow: hidden;
outline: 1px solid blue;
}
#scroller {
width: 170px;
height: 100px;
overflow: auto;
background: yellow;
}
HTML
<div id="wrapper">
<div id="scroller">
foo<br>bar<br>baz<br>foo<br>bar<br>baz<br>foo<br>bar<br>baz<br>
foo<br>bar<br>baz<br>foo<br>bar<br>baz<br>foo<br>bar<br>baz<br>
foo<br>bar<br>baz<br>foo<br>bar<br>baz<br>foo<br>bar<br>baz<br>
</div>
</div>
Upvotes: 5