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;      
}
 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM