How to use Mini Program swiper component to realize the switching effect of clicking on pictures
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!