小程序中有横向滚动的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;      
}

相关文章:

  • 2022-12-23
  • 2021-08-13
  • 2021-10-15
  • 2021-05-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-11
猜你喜欢
  • 2022-12-23
  • 2022-02-07
  • 2021-12-25
  • 2022-12-23
  • 2021-12-07
  • 2021-09-07
  • 2021-12-06
相关资源
相似解决方案