商品轮播图!!!用户购买商品展示!!

使用动画进行编写!代码如下 栗子Vue

data(){
this.isCurrent:0
}
methods:{
编写一个定时器
autoplay(){
setTimeout(()=>{
if (this.isCurrent <= 数组的长度的时候) {
this.isCurrent ++
} else {
this.isCurrent = 0
}
},3000)
}

}

动画 :
@keyframes myAnim {
0% {
transform: translateY(18px);
opacity: 0;
}
30% {
opacity: 0.4;
}
40% {
opacity: 0.7;
}
50% {
transform: translateY(0px);
opacity: 1;
}
70% {
opacity: 0.7;
}
80% {
opacity: 0.3;
}
100% {
transform: translateY(-18px);
opacity: 0;
}
}

html:

css

.toolTipbox {
position: fixed;
top: 8%;
left: 2%;
z-index: 10;
.carousel-message {
position: relative;
width: 380px;
height: 60px;
padding: 7px;
background: rgba(51, 51, 51, 0.9);
border-radius: 29px;
box-sizing: border-box;
animation: myAnim 2.3s infinite;
img {
margin-right: 12px;
margin-left: 5px;
width: 40px;
height: 40px;
border-radius: 50%;
}
span {
flex: 1;
display: inline-block;
color: #fff;
font-size: 22px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值