移动端图片轮播?

来源:互联网 发布:脱发知乎 编辑:程序博客网 时间:2024/05/16 17:07

移动端图片轮播?

在移动端的时候,经常会遇到好多图片,可以用手滑动来实现轮播?好吧,我也不知道是不是应该叫轮播,但是类似的就是那种效果。把//html<div class="product-exihibate">    <ul>        <li class="item" v-on:click="productDetail(desc.desc_id)" v-for="desc in product.desc_list">            <img class="product-pic" src="{{desc.title_image}}" alt="">            <p class="product-name">{{desc.title}}</p>            <p class="product-aims">{{desc.second_title}}</p>        </li>    </ul></div>

//css
.product-exihibate{
padding-top: 1rem;
overflow:auto;
}
.product-exihibate ul{
display: flex;
height: 10.5rem;
width: auto;
overflow-x: auto;
background-color: white;
}
::-webkit-scrollbar{ display:none;}
.item{
list-style: none;
display: inline-block;
width: 8rem;
height: 9.6rem;
margin-right: 1rem;
padding-bottom: 0.3rem;
background-color: #f5f5f5;
text-align: center;
}
.item img{
height: 6.01rem;
width: 8rem;
}
.product-name{
width: 8rem;
color: #333;
font-size: 1.05rem;
text-align: center;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.product-aims{
margin-top: 0.3rem;
width: 8rem;
color: #777;
font-size: 0.85rem;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}

原创粉丝点击