1000字范文,内容丰富有趣,学习的好帮手!
1000字范文 > 微信小程序css3动画怎么写 微信小程序动画课程-通过wxss(css)来实现-animation 属性...

微信小程序css3动画怎么写 微信小程序动画课程-通过wxss(css)来实现-animation 属性...

时间:2023-01-08 07:11:21

相关推荐

微信小程序css3动画怎么写 微信小程序动画课程-通过wxss(css)来实现-animation 属性...

animation 属性

微信小程序交流群:111733917 | 微信小程序从0基础到就业的课程:/topic/huangjuhua

定义和用法

animation 属性是一个简写属性,用于设置六个动画属性:

 animation-name

 animation-duration

 animation-timing-function

 animation-delay

 animation-iteration-count

 animation-direction

注释:请始终规定 animation-duration 属性,否则时长为 0,就不会播放动画了。

默认值: none 0 ease 0 1 normal

继承性: no

版本: CSS3

JavaScript 语法: object.style.animation=“mymove 5s infinite”

语法

animation: name duration timing-function delay iteration-count direction;

值 描述

animation-name 规定需要绑定到选择器的 keyframe 名称。。

animation-duration 规定完成动画所花费的时间,以秒或毫秒计。

animation-timing-function 规定动画的速度曲线。

animation-delay 规定在动画开始之前的延迟。

animation-iteration-count 规定动画应该播放的次数。

animation-direction 规定是否应该轮流反向播放动画。

小程序应用

Wxml代码

animation 属性是一个简写属性,用于设置六个动画属性

01

Wxss代码

.c01{

width:100px;

height:100px;

background:red;

position:relative;

animation:myfirst 5s;

}

@keyframes myfirst

{

0% {background:red; left:0px; top:0px;}

25% {background:yellow; left:200px; top:0px;}

50% {background:blue; left:200px; top:200px;}

75% {background:green; left:0px; top:200px;}

100% {background:red; left:0px; top:0px;}

}

效果图

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。