懒得讲原理了,直接贴代码:
css部分:
.slide-box { margin-top: 200px; display: -webkit-box; overflow-x: scroll; overflow-y: hidden; -webkit-overflow-scrolling: touch; }.slide-item { width: 200px; height: 200px; border: 1px solid #ccc; margin-right: 30px; }
::-webkit-scrollbar { width: 0px; }
::-webkit-scrollbar-track { background-color: none; }
::-webkit-scrollbar-thumb { background-color: none; }
::-webkit-scrollbar-thumb:hover { background-color: none; }
::-webkit-scrollbar-thumb:active { background-color: none; } html部分: <div class="slide-box"> <div class="slide-item">1</div> <div class="slide-item">2</div> <div class="slide-item">3</div> <div class="slide-item">4</div> <div class="slide-item">5</div> </div>