主页 > 前端 > javascript >
来源:自学PHP网 时间:2017-05-22 15:16 作者: 阅读:次
[导读] 这篇文章主要为大家详细介绍了微信小程序图片横向左右滑动的案例,具有一定的参考价值,感兴趣的小伙伴们可以参考一下...
本文实例为大家分享了微信小程序图片左右滑动的具体代码,供大家参考,具体内容如下 图片左右滑动效果图:
wxml代码: <scroll-view scroll-x="true"> <view class="uploadWrap" scroll-x="true"> <view class="upload_Item"> <image class="upload_Item_img" src="../../image/test1.jpg"></image> </view> <view class="upload_Item"> <image class="upload_Item_img" src="../../image/test2.jpg"></image> </view> <view class="upload_Item"> <image class="upload_Item_img" src="../../image/test3.jpg"></image> </view> <view class="upload_Item"> <image class="upload_Item_img" src="../../image/test4.jpg"></image> </view> <view class="upload_Item"> <image class="upload_Item_img" src="../../image/test1.jpg"></image> </view> <view class="upload_Item"> <image class="upload_Item_img" src="../../image/test2.jpg"></image> </view> <view class="upload_Item"> <image class="upload_Item_img" src="../../image/test3.jpg"></image> </view> </view> </scroll-view> wxss代码: .uploadWrap{height:160rpx; width:100%; display: flex; display: -webkit-box; flex-direction: column;} .upload_Item{ width: 160rpx; height: 160rpx; flex: 1;} .upload_Item_img{ width: 160rpx; height: 160rpx;} wxml从后台获取数据代码: <scroll-view scroll-x="true"> <view class="uploadWrap" scroll-x="true" > <view class="upload_Item" wx:for="{{imgUrls}}" wx:key="id"> <image class="upload_Item_img" src="{{item.imgurl}}"data-id="{{item.id}}" bindtap="changeMainImgFn2"></image> <icon type="clear" size="16" class="upload_Btn" color="#f64400"></icon> <view class="upload_mask {{upload_ImgSelId2==item.id? 'show':' ' }}">主图</view> </view> </view> </scroll-view> 以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持自学php网。 |
自学PHP网专注网站建设学习,PHP程序学习,平面设计学习,以及操作系统学习
京ICP备14009008号-1@版权所有www.zixuephp.com
网站声明:本站所有视频,教程都由网友上传,站长收集和分享给大家学习使用,如由牵扯版权问题请联系站长邮箱904561283@qq.com