### [小程序怎么做滚动图片](https://www.prosaas.cn/article/16857) **Published:** 2020-03-21T06:05:36 **Author:** 5201314 **Excerpt:** 左右滑动可以切换展示图片: pages/test/test.js: pages/test/test.wxss:… ![](https://img.php.cn/upload/article/000/000/039/5e75ad73d49dd180.jpg) 左右滑动可以切换展示图片: pages/test/test.js: // pages/test/test.js Page({ data: { imgUrls:\[ 'http://dl.bizhi.sogou.com/images/1440x900/2014/05/14/611368.jpg', 'http://dl.bizhi.sogou.com/images/1440x900/2013/10/19/394877.jpg', 'http://img04.sogoucdn.com/app/a/100520093/ca86e620b9e623ff-d72d635343d5bade-dcf2acda7a45cb44f172db138bdf8d2d.jpg', \] }, //事件处理函数 toupper:function(){ console.log("触发了toupper"); } }) pages/test/test.wxss: .img{ width: 100%; } 心得: swiper组件:滑块视图容器。 可以为swiper添加autoplay属性,是之自动播放,例如:autoplay=”true” swiper组件中使用的是image单标签,而不是双标签(否则报错)。 推荐:《小程序开发教程》 以上就是小程序怎么做滚动图片的详细内容,更多请关注知企PROSAAS其它相关文章! **Categories:** 后端开发 ---