小程序中动画

微信小程序动画专题课程-通过wxss(css)来实现-第8课-animation-iteration-count属性

时间:2019/1/14 14:49:55  作者:互联网  来源:网络转载  查看:3799  评论:0
内容摘要:animation-iteration-count属性 定义和用法animation-iteration-count 属性定义动画的播放次数。默认是 1 默认值:1继承性:no版本:CSS3JavaScript 语法:object.style.animationIteration...

animation-iteration-count属性

定义和用法

animation-iteration-count 属性定义动画的播放次数。默认是 1

默认值:

1

继承性:

no

版本:

CSS3

JavaScript 语法:

object.style.animationIterationCount=3

语法

animation-iteration-count: n|infinite;

 

描述

n

定义动画播放次数的数值。

infinite

规定动画应该无限次播放。

 

小程序应用

 

Wxml代码

<view>animation-delay 规定动画何时开始。默认是 0</view>

<view class='c01'>01</view>

 

<image src='/images/logo.png' class='c02'></image>

Wxss代码

.c01{

width:100px;

height:100px;

background:red;

position:relative;

/*animation:mymove 5s infinite;  infinite        规定动画应该无限次播放。 */

animation:mymove 3s;

animation-iteration-count:1;

}

@keyframes mymove

{

from {left:0px;}

to {left:200px;}

}

 

.c02{

width: 100px; height: 100px;

position:relative;

animation:mymove2 5s infinite;

animation-iteration-count:2;

}

@keyframes mymove2

{

from {left:0px;}

to {left:200px;}

}

效果图
微信小程序动画专题课程-通过wxss(css)来实现-第8课-animation-iteration-count属性



欢迎大家学习我的视频课程:微信小程序动画课程-通过wxss(css)来实现

微信小程序动画专题课程-通过wxss(css)来实现-第8课-animation-iteration-count属性

相关评论
评论者:      验证码:  点击获取验证码
本类推荐
咨询QQ/微信:45157718 点击这里给我发消息 | 电话:13516821613 | 浙江杭州余杭区东港路118号雷恩科技创新园 | 网站支持:杭州摇亿网络科技 | 浙ICP备06056032号-6 |