Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use Mini Program swiper component to realize the switching effect of clicking on pictures

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how to use Mini Program swiper components to achieve click picture switching effect", the article explains the content is simple and clear, easy to learn and understand, now please follow the editor's ideas slowly in depth, together to study and learn "how to use Mini Program swiper components to achieve click picture switching effect" it!

Mini Program swiper component to achieve click-to-picture rotation switch effect, or relatively simple.

For example:

1.index.wxml

There are several attributes that need to be explained.

The cycle developed by WeChat Mini Programs is used.

Here I am traversing the movies [] array. It's item.

2.index.js

/ / index.js

/ / obtain an application instance

Var app = getApp ()

Page ({

Data: {

Movies: [

{url:' http://img04.tooopen.com/images/20130712/tooopen_17270713.jpg'}

{url:' http://img04.tooopen.com/images/20130617/tooopen_21241404.jpg'}

{url:' http://img04.tooopen.com/images/20130701/tooopen_20083555.jpg'}

{url:' http://img02.tooopen.com/images/20141231/sy_78327074576.jpg'}

]

}

OnLoad: function () {

}

})

3.WXML

/ * * index.wxss**/

.swiper {

Height: 400rpx

Width: 100%

}

.swiper image {

Height: 100%

Width: 100%

}

Thank you for your reading, the above is the content of "how to use Mini Program swiper component to achieve click-to-picture switching effect". After the study of this article, I believe you have a deeper understanding of how to use Mini Program swiper component to achieve click-to-picture switching effect, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report