小程序如何在轮播图里面实现点击跳转

小程序如何在轮播图里面实现点击跳转

轮播图可以使用swiper组件来实现,点击跳转页面可以使用navigator组件来实现,所以实现点击轮播图跳转页面的方法是:在swiper组件的swiper-item软件开发定制mhkj33组件里嵌套一个navigator即可。

具体实现代码如下:

1、WXML代码

1

2

3

4

5

6

7

8

9

10

11

<!–轮播图 –>

<view class=&#39;swiperBanner&#39;>

<swip软件开发定制mhkj33er indicator-dots=&#39;{{indicatorDots}}&#39; autoplay=&#39;{{autoplay}}&#39; interval=&#39;{{interv软件开发定制mhkj33al}}&#39; duration=&#39;{{duration}}&#39; circular=&#39;{{circular}}&#39;>

<swiper-item  wx:for=”{{im软件开发定制mhkj33gUrls}}” wx:key=&#39;{{index}}&#39;>

<navigator url=&#39;{{item.link}}&#39;>

<image src=”{{item.url}}”软件开发定制mhkj33 class=”slide-image” mode=”aspectFill”></image>

</navigator>

</swiper-item>

</swiper>

</view>

</view>

2、WXSS代码

1

2

3

4

5

6

7

8

9

10

11

12

13

14

/* 轮播 */

.swiperBanner{

width:100%;

height:420rpx !important;

margin:0 auto;软件开发定制mhkj33

}

.swiperBanner image{

width:100%;

height:420rpx !important;

}

swiper {

width:100%;

height:420rpx !importan软件开发定制mhkj33t;

}

登录后复制

3、JS代码

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

indicatorDots:false,

autoplay:true,

interval:3000,

duration:软件开发定制mhkj33 800,

circular:true,

// 轮播图

imgUrls: [

{

link:&#39;../activity/washCar1/index/index&#39;,

url:&#39;https:/软件开发定制mhkj33/localhost/static/ttcf/img/banner8.png&#39;,

},

{

link: &#39;../activity/Odysseus/index/index&#39;,

url:软件开发定制mhkj33 &#39;https://localhost/static/ttcf/img/banner9.png&#39;,

},

],

登录后复制

PHP中文网,大量免费小程序开发教程,欢迎学习!

以上就是小程序如何在软件开发定制mhkj33轮播图里面实现点击跳转的详细内容,更多请关注php中文网其它相关文章!

© 版权声明
THE END
喜欢就支持一下吧
点赞501 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容