当前位置:网站首页>uni-app实现广告滚动条
uni-app实现广告滚动条
2022-07-01 13:25:00 【前端 贾公子】
参数说明
- circular Boolean false 是否采用衔接滑动,即播放到末尾后重新回到开头
- vertical Boolean false 滑动方向是否为纵向
- previous-margin String 0px 前边距,可用于露出前一项的一小部分,接受 px 和 rpx
- next-margin String 0px 后边距,可用于露出后一项的一小部分,接受 px 和 rpx 值
- autoplay Boolean false 是否自动切换
- disable-touch Boolean false 是否禁止用户 touch 操作
- interval Number 5000 自动切换时间间隔
- duration Number 500 滑动动画时长
- @change EventHandle
- current 改变时会触发 change 事件,event.detail = {current: current, source: source}
- current Number 0 当前所在滑块的 index
html
<view class="scroll_box">
<swiper class="swiper" circular="true" vertical="true" :previous-margin='50+"rpx"' :next-margin='50+"rpx"'
:autoplay="true" disable-touch='false' :interval="3000" :duration="2000" @change='EventHandle'>
<swiper-item v-for="(item,index) in list" :key="index">
<view :class="current==index?'swiper-item':'' ">{
{item}}</view>
</swiper-item>
</swiper>
</view>
js
data() {
return {
current: 0,
list: [
'刚刚 1657*****8768 收到佣金9.9999元',
'刚刚 1657*****8768 收到佣金9.9999元',
'刚刚 1657*****8768 收到佣金9.9999元',
'刚刚 1657*****8768 收到佣金9.9999元',
'刚刚 1657*****8768 收到佣金9.9999元',
'刚刚 1657*****8768 收到佣金9.9999元',
],
};
},
methods: {
EventHandle(e) {
this.current = e.target.current;
},
},
css
.scroll_box {
background: #FFFFFF;
margin: 30rpx;
border-radius: 10rpx;
.swiper {
height: 150rpx;
}
.swiper-item {
background-color: #FECA71;
font-size: 32rpx;
}
}
边栏推荐
- Global and Chinese silicone defoamer production and marketing demand and investment forecast analysis report Ⓨ 2022 ~ 2027
- word2vec训练中文词向量
- Computer network interview knowledge points
- 焱融看 | 混合云时代下,如何制定多云策略
- MySQL六十六问,两万字+五十图详解!复习必备
- SAP intelligent robot process automation (IRPA) solution sharing
- 一文读懂TDengine的窗口查询功能
- ArrayList capacity expansion mechanism and thread safety
- SAP 智能机器人流程自动化(iRPA)解决方案分享
- 终端识别技术和管理技术
猜你喜欢

Summary of interview questions (1) HTTPS man in the middle attack, the principle of concurrenthashmap, serialVersionUID constant, redis single thread,

JS变色的乐高积木
Example code of second kill based on MySQL optimistic lock

Several models of IO blocking, non blocking, IO multiplexing, signal driven and asynchronous IO

Beidou communication module Beidou GPS module Beidou communication terminal DTU
![[machine learning] VAE variational self encoder learning notes](/img/38/3eb8d9078b2dcbe780430abb15edcb.png)
[machine learning] VAE variational self encoder learning notes

Meta enlarge again! VR new model posted on CVPR oral: read and understand voice like a human

8 popular recommended style layout

进入前六!博云在中国云管理软件市场销量排行持续上升

啟動solr報錯The stack size specified is too small,Specify at least 328k
随机推荐
Anti fraud, refusing to gamble, safe payment | there are many online investment scams, so it's impossible to make money like this
04 redis source code data structure dictionary
一文读懂TDengine的窗口查询功能
流量管理技术
运行游戏时出现0xc000007b错误的解决方法[通俗易懂]
洞态在某互联⽹⾦融科技企业的最佳落地实践
Global and Chinese polypropylene industry prospect analysis and market demand forecast report Ⓝ 2022 ~ 2027
spark源码阅读总纲
Benefiting from the Internet, the scientific and technological performance of overseas exchange volume has returned to high growth
Spark source code (V) how does dagscheduler taskscheduler cooperate with submitting tasks, and what is the corresponding relationship between application, job, stage, taskset, and task?
Report on the current situation and development trend of bidirectional polypropylene composite film industry in the world and China Ⓟ 2022 ~ 2028
Research Report on China's software outsourcing industry investment strategy and the 14th five year plan Ⓡ 2022 ~ 2028
焱融看 | 混合云时代下,如何制定多云策略
Flutter SQLite使用
Simple two ball loading
Leetcode第一题:两数之和(3种语言)
基于mysql乐观锁实现秒杀的示例代码
启动solr报错The stack size specified is too small,Specify at least 328k
SAP intelligent robot process automation (IRPA) solution sharing
Wave animation color five pointed star loader loading JS special effects