当前位置:网站首页>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;
}
}
边栏推荐
- Qtdeisgner, pyuic detailed use tutorial interface and function logic separation (nanny teaching)
- Introduction to topological sorting
- 6年技术迭代,阿里全球化出海&合规的挑战和探索
- JS变色的乐高积木
- 9. Use of better scroll and ref
- Word2vec training Chinese word vector
- The stack size specified is too small, specify at least 328k
- Flutter SQLite使用
- During Oracle CDC data transmission, the CLOB type field will lose its value during update. There is a value before update, but
- 3.4 data query in introduction to database system - select (single table query, connection query, nested query, set query, multi table query)
猜你喜欢
La taille de la pile spécifiée est petite, spécifiée à la sortie 328k
SAP intelligent robot process automation (IRPA) solution sharing
学会使用LiveData和ViewModel,我相信会让你在写业务时变得轻松
Terminal identification technology and management technology
5G工业网关的科技治超应用 超限超重超速非现场联合执法
Application of 5g industrial gateway in scientific and technological overload control; off-site joint law enforcement for over limit, overweight and overspeed
SAP 智能机器人流程自动化(iRPA)解决方案分享
一款Flutter版的记事本
Meta enlarge again! VR new model posted on CVPR oral: read and understand voice like a human
孔松(信通院)-数字化时代云安全能力建设及趋势
随机推荐
Flow management technology
SVG钻石样式代码
5. Use of ly tab plug-in of header component
6. Wiper part
minimum spanning tree
Simplex, half duplex, full duplex, TDD and FDD
Example code of second kill based on MySQL optimistic lock
Router. use() requires a middleware function but got a Object
leetcode 322. Coin change (medium)
7. Icons
Beidou communication module Beidou GPS module Beidou communication terminal DTU
Analysis report on the development prospect and investment strategic planning of China's wafer manufacturing Ⓔ 2022 ~ 2028
Detailed explanation of parallel replication examples in MySQL replication
受益互联网出海 汇量科技业绩重回高增长
Apache-Atlas-2.2.0 独立编译部署
2.15 summary
一款Flutter版的记事本
Professor Li Zexiang, Hong Kong University of science and technology: I'm wrong. Why is engineering consciousness more important than the best university?
MySQL报错1040Too many connections的原因以及解决方案
Declare an abstract class vehicle, which contains the private variable numofwheel and the public functions vehicle (int), horn (), setnumofwheel (int) and getnumofwheel (). Subclass mot