源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

微信小程序实现轮播图效果

  • 时间:2022-02-26 17:25 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:微信小程序实现轮播图效果
微信小程序实现轮播图,和网站,APP的效果差不多,代码少,效率高。 先来看看效果图: [img]http://files.jb51.net/file_images/article/201709/20179784208017.gif?20178784233[/img] 主要用swiper + swiper-item来实现
 <view class='swiper'>滑块视图容器</view>

<!--
 indicator-dots='true' 是否显示指示点 默认 false
 indicator-color:指示点颜色
 indicator-active-color:选中的指示点颜色
 autoplay:是否自动切换 默认:false
 interval:自动切换时间间隔
 duration:滑动动画时长
 vertical 是否改成纵向, 默认 false
 -->

<swiper indicator-dots='true' indicator-color='gray' indicator-active-color='green' autoplay='true' interval='5000' duration='500'>
 <block wx:for="{{imgUrl}}">
  <swiper-item class="item_image">
   <image src='{{item}}' class='swiper_image' mode="aspectFill"></image>
  </swiper-item>
 </block>

</swiper>

一个简单的小案例,轮播图,代码简洁,功能强大。 源码点击[url=https://github.com/DickyQie/wechat-applet-basics/tree/swiper-carousel]下载[/url] 以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持编程素材网。
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部