当前位置:网站首页>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%;
}边栏推荐
- -Bash: wget: command not found
- Fragment usage
- Business leaders compete for CIO roles
- C language - structure II
- How to start cloud native application development
- System Verilog - randomize
- Complete Guide to web application penetration testing
- Nacos cluster starts throwing set of SQL_ SELECT_ LIMIT is not support
- Mariana Trench, Facebook's open source code analysis tool
- Using flex to implement common layouts
猜你喜欢

How to select the best test cases for automation?
An analysis of the comments on the TV series Douban by procedural apes

Complete Guide to web application penetration testing
Millions of dollars worth of NFT were stolen in the attack, and Google issued an emergency warning to 3.2 billion users worldwide | February 21 global network security hotspot

Software testing methods: a short guide to quality assurance (QA) models
About swagger

Four security issues of low code and no code development

The 'ng' entry cannot be recognized as the name of a cmdlet, function, script file, or runnable program. Check the spelling of the name. If you include a path, make sure the path is correct, and then

Exception: Gradle task assembleDebug failed with exit code 1

Crmeb multi merchant PC packaging tutorial
随机推荐
Why are more and more people studying for doctors? Isn't it more and more difficult to graduate a doctor?
Common MySQL commands of installation free version
Operation and maintenance guide | cos back source setting practice
How to create simple shapes in illustrator 2022
Seven strategies for successfully integrating digital transformation
[golang] leetcode intermediate - jumping game & different paths
An analysis of the comments on the TV series Douban by procedural apes
国家出手了!对知网启动网络安全审查
基于BGP实现纯三层容器网络方案
Millions of dollars worth of NFT were stolen in the attack, and Google issued an emergency warning to 3.2 billion users worldwide | February 21 global network security hotspot
Ten excellent business process automation tools for small businesses
Issue 39: MySQL time class partition write SQL considerations
Mental models: the best way to make informed decisions - farnam
On software requirement analysis
Get max value of a bit column - get max value of a bit column
Flutter dart regular regexp special characters $, () (IV)
How to use SEO to increase the inquiry volume?
[quick news] the jeecgboot low code platform was successfully selected into the 2021 scientific innovation China · open source innovation list
What are the reasons for the abnormal playback of the online channel of the channel accessed by easycvr national standard protocol?
EasyGBS视频平台TCP主动模式拉流异常情况修复