<template>
<div class="TextRunning">
<div class="myMarquee" style="width:300px">
<span>**</span>
<div class="myMarqueeLay">
<div class="myMarqueeWrap">
<div class="myMarqueeContent">
<span v-for="(item,index) in textArr" :key="index" @click="()=>{}">{{item.title}}</span>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'ScrollToNotice',
data() {
return {
textArr: [
{
title: '1111111111111'
},
{
title: '22222222222222'
}
]
}
}
}
</script>
<style scoped lang="less">
.TextRunning {
/* 跑马灯样式--开始 */
display: inline-block;
.myMarquee {
display: flex;
align-items: center;
//width: calc( 100vh - 200px );
//background-color: #f00;
.myMarqueeLay {
position: relative;
width: 100%;
height: 40px;
margin: 0 8px;
overflow: hidden;
line-height: 40px;
//background: rgba(255, 255, 255, .6);
}
.myMarqueeWrap {
width: 100%;
height: 100%;
animation: cssmarqueeWrapper 30s linear infinite;
&:hover {
cursor: pointer;
animation-play-state: paused;
}
}
.myMarqueeContent {
position: absolute;
top: 0;
left: 0;
height: 100%;
margin: 0;
font-size: 12px;
white-space: nowrap;
text-align: left;
//background: rgba(255, 255, 255, .6);
transform: translateX(0);
animation: cssmarquee 30s linear infinite;
.myMarqueeItem {
margin-right: 12px;
}
&:hover {
cursor: pointer;
animation-play-state: paused;
}
}
@keyframes cssmarqueeWrapper {
0% {
transform: translateX(100%);
}
100% {
transform: translateX(0);
}
}
@keyframes cssmarquee {
0% {
transform: translateX(0);
}
100% {
transform: translateX(-100%);
}
}
}
/* 跑马灯样式---结束 */
}
</style>
文字滚动 vue
最新推荐文章于 2023-12-02 10:30:00 发布