当前位置:网站首页>直播app系统源码,上下叠层样式的轮播图
直播app系统源码,上下叠层样式的轮播图
2022-07-27 19:19:00 【云豹网络科技】
直播app系统源码,上下叠层样式的轮播图
<template>
<div class="article-main" @mouseover='mouseOver()' @mouseleave="mouseLeave()">
<img src="../../assets/a3.jpeg" :class="v1" />
<img src="../../assets/a2.jpeg" :class="v2" />
<img src="../../assets/a1.jpeg" :class="v3" />
<div class="dot-view">
<div :class="dot1">
</div>
<div :class="dot2">
</div>
<div :class="dot3">
</div>
</div>
<div class="arrow-view" v-show="isActive">
<img src="../../assets/btn-l-d.png" class="arrow-left" @click="toLeft()" />
<img src="../../assets/btn-r-d.png" class="arrow-right" @click="toRight()" />
</div>
</div>
</template>
<script>
export default {
name: 'home',
data() {
return {
timer: '',
isActive: false,
value: 1,
v1: 'banner wz1',
v2: 'banner wz2',
v3: 'banner wz3',
dot1: 'dot-1 dot-color-actived',
dot2: 'dot-2 dot-color-normal',
dot3: 'dot-3 dot-color-normal'
}
},
methods: {
toLeft() {
this.value--
if (this.value == 0) {
this.value = 3
}
this.changeClasss()
},
toRight() {
this.value++
if (this.value > 3) {
this.value = 1
}
this.changeClasss()
},
mouseOver() {
this.isActive = true
clearInterval(this.timer);
},
// 移出
mouseLeave() {
this.isActive = false
this.timer = setInterval(this.get, 3000);
},
changeClasss() {
if (this.value == 1) {
this.v1 = 'banner wz1'
this.v2 = 'banner wz2'
this.v3 = 'banner wz3'
this.dot1 = 'dot-1 dot-color-actived'
this.dot2 = 'dot-2 dot-color-normal'
this.dot3 = 'dot-3 dot-color-normal'
}
if (this.value == 2) {
this.v1 = 'banner wz2'
this.v2 = 'banner wz3'
this.v3 = 'banner wz1'
this.dot1 = 'dot-1 dot-color-normal'
this.dot2 = 'dot-2 dot-color-actived'
this.dot3 = 'dot-3 dot-color-normal'
}
if (this.value == 3) {
this.v1 = 'banner wz3'
this.v2 = 'banner wz2'
this.v3 = 'banner wz1'
this.dot1 = 'dot-1 dot-color-normal'
this.dot2 = 'dot-2 dot-color-normal'
this.dot3 = 'dot-3 dot-color-actived'
}
},
get() {
this.value++;
if (this.value > 3) {
this.value = 1
}
this.changeClasss()
}
},
mounted() {
this.timer = setInterval(this.get, 3000);
},
beforeDestroy() {
clearInterval(this.timer);
},
}
</script>
<style scoped>
.arrow-left {
position: absolute;
left: 20px;
top: 250px;
cursor: pointer;
}
.arrow-right {
position: absolute;
left: 280px;
top: 250px;
cursor: pointer;
}
.article-main {
width: 320px;
height: 300px;
background-color: #aaffff;
position: relative;
}
.banner {
border-radius: 4px;
position: absolute;
transition: all 1s;
}
.wz1 {
width: 280px;
height: 200px;
left: 20px;
z-index: 777;
top: 20px;
}
.wz2 {
width: 290px;
height: 200px;
left: 15px;
top: 30px;
z-index: 888;
}
.wz3 {
width: 300px;
height: 200px;
left: 10px;
top: 40px;
z-index: 999;
}
.dot-view {
position: absolute;
left: 120px;
top: 255px;
display: flex;
flex-direction: row;
}
.dot-color-actived {
background-color: #ff0000;
}
.dot-color-normal {
background-color: #333;
}
.dot-1 {
width: 10px;
height: 10px;
border-radius: 50%;
}
.dot-2 {
width: 10px;
height: 10px;
border-radius: 50%;
margin-left: 20px;
}
.dot-3 {
margin-left: 20px;
width: 10px;
height: 10px;
border-radius: 50%;
}
</style>
以上就是 直播app系统源码,上下叠层样式的轮播图,更多内容欢迎关注之后的文章
边栏推荐
- 软件测试面试题:软件测试项目从什么时候开始?为什么?
- 简单手动实现Map
- [C language] high precision addition, subtraction, multiplication and division template
- 零钱通项目(两个版本)含思路详解
- Ziguang zhanrui: dozens of 5g terminals based on chunteng 510 will be commercially available in 2020
- 聊聊 MySQL 事务二阶段提交
- 软件测试面试题:设计测试用例时应该考虑哪些方面,即不同的测试用例针对那些方面进行测试?
- 看起来是线程池的BUG,但是我认为是源码设计不合理。
- Regular expression exercise
- Form of objects in memory & memory allocation mechanism
猜你喜欢

The gratitude and resentment between the four swordsmen and code review: "abandon all chaos" to "prodigal son returns"

Microsoft store can't download apps, vs2019 can't download plug-ins solution

项目分析(从技术到项目、产品)

B站崩了,如果我们是那晚负责修复的开发人员

Lvs+kept highly available cluster

Analysis of STL source code
Excalidraw: an easy-to-use online, free "hand drawn" virtual whiteboard tool

8000字讲透OBSA原理与应用实践

JVM memory model interview summary

单核CPU, 1G内存,也能做JVM调优吗?
随机推荐
Basic usage of two-dimensional array
@Detailed introduction of requestparam annotation
MySQL execution process and order
IDEA常用快捷键及设置方法
Pytoch distributed training
Software testing interview question: what is the focus of unit testing, integration testing, and system testing?
[question 21] idiom Solitaire (Beijing Institute of Technology / Beijing University of Technology / programming methods and practice / primary school)
ThreadLocal principle and source code analysis (click in step by step, don't recite, learn ideas)
紫光展锐:2020年将有数十款基于春藤510的5G终端商用
数组扩容、排序、嵌套语句应用
Software test interview question: when saving a text file under windows, a save dialog box will pop up. If a test case is established for the file name, how should equivalent classes be divided?
How to deal with high concurrency deadlock?
Software testing interview question: when does the software testing project start? Why?
An article takes you into the world of pycharm - stop asking me about pycharm installation and environment configuration!!!
Qt取出输入框字符串,lineEdit
Oppo core making plan officially announced: the first chip or oppo M1
B站崩了,那晚负责修复的开发人员做了什么?
Software testing interview question: how many strategies are there for system testing?
Software test interview question: suppose there is a text box that requires the input of a 10 character postal code, how should the text box be divided into equivalent classes?
Mysql 数据恢复流程 基于binlog redolog undolog