移除网页滚动条,但依然可以用鼠标滚动的方法

A better solution is to set the target div to overflow:scroll, and wrap it inside a second element that is 8px narrower, who's overflow:hidden.

The target element will have a hidden scrollbar. The mousewheel will work, but the scroll bar will not show.

<divstyle='overflow:hidden;width:200px;'><divstyle='overflow:scroll;width:208px'> My mousewheel scrollable content here.... </div></div>

Note that 8px as the width of the scrollbar is a random number - it's probably a lot more, and it could require per browser CSS.

 

原文链接:http://stackoverflow.com/questions/3253199/remove-html-scrollbars-but-allow-mousewheel-scrolling

你可能感兴趣的:(滚动条)