当前位置:网站首页>Wechat applet development - Implementation of rotation chart
Wechat applet development - Implementation of rotation chart
2022-06-24 18:23:00 【Yang Yang D_ C】
Applet , The mobile terminal is inseparable from the function of the carousel map , The following is to write a small program to share with you the function of the rotation chart
design sketch :

1. Page code
<!--index.wxml-->
<view class="container">
<!-- Shuffling figure -->
<swiper class="home-swiper" indicator-dots="true" autoplay="{
{autoplay}}" interval="{
{interval}}" duration="{
{duration}}">
<block wx:for-items="{
{lunboData}}">
<swiper-item>
<image src="{
{item.imgurl}}" class="slide-image" />
</swiper-item>
</block>
</swiper>
</view>2. Configuration information
//index.js
Page({
data: {
// Carousel configuration
autoplay: true,
interval: 3000,
duration: 1200
},
onLoad: function () {
var that = this;
var data = {
"datas": [
{
"id": 1,
"imgurl": "../../images/a1.jpg"
},
{
"id": 2,
"imgurl": "../../images/a2.jpg"
}
]
};
that.setData({
lunboData: data.datas
})
}
})3. Configuration style
/**index.wxss**/
/* Carousel control */
.home-swiper {
width: 95%;
height: 360rpx;
}
.slide-image {
width: 100%;
height: 100%;
}边栏推荐
- Welcome to the network security threat information sharing program
- How to create simple shapes in illustrator 2022
- Recommend 14 commonly used test development tools
- Application service access configuration parameters
- Selection (031) -cool_ How long can secret be accessed?
- Yum to install warning:xxx: header V3 dsa/sha1 signature, key ID 5072e1f5: nokey
- 腾讯云荣获“可信云技术最佳实践-虚拟化”
- TCE was shortlisted as a typical solution for ICT innovation of the Ministry of industry and information technology in 2020
- Leetcode question 136 [single number]
- The mixed calculation of rpx and PX in JS by the uniapp applet
猜你喜欢

What is decision intelligence?

Cloud service selection of enterprises: comparative analysis of SaaS, PAAS and IAAs
About swagger

How do yaml files and zmail collide with the spark of the framework, and how can code and data be separated gracefully?

Ten software development indicators for project managers

How does the chief information security officer discuss network security with the enterprise board of directors

NVM download, installation and use

C language - structure II

Flutter dart regular regexp matches non printing characters \cl\cj\cm\ck

Digital transformation informatization data planning and technology planning
随机推荐
ASP. Net hosting uploading file message 500 error in IIS
What is decision intelligence?
He "painted" what a smart city should look like with his oars
EasyNVR使用Onvif探测设备失败,显示“无数据”是什么原因?
Application service access configuration parameters
Project Management Guide: tips, strategies and specific practices
From file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql The GPG key to retrieve the key source "MySQL 5.7 community server" is installed, but not applicable to
Flutter dart regular regexp matches non printing characters \cl\cj\cm\ck
Application service access configuration parameters
TCE was shortlisted as a typical solution for ICT innovation of the Ministry of industry and information technology in 2020
Mysql database performance testing tool recommendation
Is it safe to open an account online? What should I do?
How to select the best test cases for automation?
Bigdecimalavoiddoubleconstructorrule: do not directly use the double variable as a parameter to construct BigDecimal
Operation and maintenance guide | cos back source setting practice
Fragment usage
EasyGBS视频平台TCP主动模式拉流异常情况修复
Rapidssl getting started SSL certificate
Recommend 14 commonly used test development tools
Top ten popular codeless testing tools