小程序图片幻灯片播放

Github地址

github.com/godaangel/w…html

小程序片断代码直接查看

developers.weixin.qq.com/s/in6OUqmk7…git

用于须要幻灯片展现一系列图片,而且须要提供一些转场效果的时候github

  • 代码为小程序片断代码
  • 转场效果在每次访问时随机生成,内置5种,若是须要的话能够自行开发

使用方式

//引入组件
"usingComponents": {
    "image-player": "../image-player/image-player"
}
复制代码
<!-- 直接引入 backImageUrls表示图片地址Array -->
<image-player imageList="{{backImageUrls}}" needBackground="{{true}}" backgroundOpacity="{{0.6}}" animationDuration="{{4000}}" ></image-player>
复制代码

配置说明

名称 说明 类型 默认值
imageList 图片连接数组 Array 必填
needBackground 是否须要背景填充 Boolean true
backgroundOpacity 背景填充透明度 Number 0.5
animationDuration 动画时长 Number 5000 (单位 ms)
相关文章
相关标签/搜索