龙空技术网

微信小程序幻灯片简单制作代码

小曼之恋 62

前言:

当前兄弟们对“js图片幻灯片代码”都比较关怀,兄弟们都需要分析一些“js图片幻灯片代码”的相关知识。那么小编也在网摘上收集了一些有关“js图片幻灯片代码””的相关文章,希望各位老铁们能喜欢,小伙伴们一起来了解一下吧!

微信小程序幻灯片wxml代码

<swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}">

<block wx:for="{{imgUrls}}">

<swiper-item>

<image src="{{item}}" style="width:100%;"/>

</swiper-item>

</block>

</swiper>

微信小程序幻灯片js代码:

Page({

data: {

imgUrls: [

'图片地址,使用绝对地址1',

'图片地址,使用绝对地址2'

],

indicatorDots: true,

autoplay: true,

interval: 5000,

duration: 1000

}

})

说明:swiper滑块视图容器。swiper-item仅可放置在<swiper/>组件中,宽高自动设置为100%。indicatorDots是否显示面板指示点,默认值false为不显示指示点。autoplay是否自动切换,默认值为false不自动切换。interval自动切换时间间隔设置,duration滑动动画时长设置。

标签: #js图片幻灯片代码