H5实现横向滚动的方法总结

小程序中有横向滚动的swiper,H5中目前得手动实现。

实现方法如下:

外层需要设置:

 overflow: scroll;white-space: nowrap;

内层需要设置:
display: inline-block; 
 <div class="noticeListBox">
       <div class="noticeList" v-for="(item,index) in 10">
              
       </div>
</div>

.noticeListBox {
    width: 100%;
    box-sizing: border-box;
    overflow: scroll;
    white-space: nowrap;
}

.noticeListBox::-webkit-scrollbar {
    display: none;
}

.noticeList{
  display: inline-block;      
}
 

猜你喜欢

转载自www.cnblogs.com/teamemory/p/11603123.html
今日推荐