FCC---Animate Elements Continually Using an Infinite Animation Count---设置animation-iteration-count的次数为无限,让小球一直跳动
The previous challenges covered how to use some of the animation properties and the @keyframes
rule.
Another animation property is the animation-iteration-count
, which allows you to control how many times you would like to loop through the animation.
Here's an example:
animation-iteration-count: 3;
In this case the animation will stop after running 3 times, but it's possible to make the animation run continuously by setting that value to infinite.
把次数改为无线infinite就一直动。
练习题目:
To keep the ball bouncing on the right on a continuous loop, change the
animation-iteration-count
property to infinite
.
练习代码: (不需要全部写,填空进去)
<style> #ball {
width: 100px;
height: 100px;
margin: 50px auto;
position: relative;
border-radius: 50%;
background: linear-gradient(
35deg,
#ccffff,
#ffcccc
);
animation-name: bounce;
animation-duration: 1s;
animation-iteration-count: infinite;
} @keyframes bounce{
0% {
top: 0px;
}
50% {
top: 249px;
width: 130px;
height: 70px;
}
100% {
top: 0px;
}
}
</style>
<div id="ball"></div>
效果:
在设置区域内,带一个好看背景色的小球,上下弹动,小球的大小会挤压又恢复,通过@keyframe设置的0%-100%的值实现的
FCC---Animate Elements Continually Using an Infinite Animation Count---设置animation-iteration-count的次数为无限,让小球一直跳动的更多相关文章
- Android中xml设置Animation动画效果详解
在 Android 中, Animation 动画效果的实现可以通过两种方式进行实现,一种是 tweened animation 渐变动画,另一种是 frame by frame animation ...
- android中设置Animation 动画效果
在 Android 中, Animation 动画效果的实现可以通过两种方式进行实现,一种是 tweened animation 渐变动画,另一种是 frame by frame animation ...
- Android 动画——Frame Animation与Tween Animation
很多手机应用的引导页都是动画的,添加动画后的应用画面会更加生动灵活,今天博主也学习了Android中Animation的使用,下面来总结下. android中的Animation分为两种,一种是Fr ...
- Uni2D 入门 -- Animation Clip 和 Animation API
转载 csdn kakashi8841 http://blog.csdn.net/kakashi8841/article/details/17599505 Animation Clip 一个anima ...
- Android动画View Animation与Drawable Animation
Animations 一.Animations介绍 Animations是一个实现android UI界面动画效果的API,Animations提供了一系列的动画效果,可以进行旋转.缩放.淡入淡出等, ...
- Animation.setFillAfter and Animation.setFillBefore的作用
转:http://blog.csdn.net/yangweigbh/article/details/9788531 setFillAfter(boolean fillAfter) 在Android ...
- 转:在两个页面间翻转设置Animation动作的一些总结
今天碰到两个页面之间翻转的动作设计问题,发现了一些问题,故做个总结,很多都写在注释部分: 1.首先,我们来手动创建两个view以及相应的viewController.是手动,不是用IB (1)刚开始只 ...
- 设置Animation 的播放位置
AnimationState.normalizedTime 官方文档的描述 Description The normalized time of the animation. A value of 1 ...
- (手冊)Animation 之 使用Animation View
观看游戏物体上的动画(Viewing Animations on a GameObject) Animation View 是与 Hierarchy View.Scene View和Inspector ...
随机推荐
- css 揭秘-读书笔记
css 揭秘 [希]Lea verou 著 css 魔法 译 该书涵盖7大主题,47个css技巧,是css进阶必备书籍,开阔思路,探寻更优雅的解决方案.这本书完全用css渲染出的html写成的(布局. ...
- ASP.NET MVC5基础 – MVC文件架构
创建MVC项目 首先,我们使用Visual Studio2019创建一个MVC架构的应用程序.步骤如下:首先打开VS2019,在启动页选择[创建新项目].然后选择创建 ASP.NET Web 应用程序 ...
- JS中的call,apply和bind及记忆方式
总结 call().apply()和bind()都是用来改变函数执行时的上下文,可借助它们实现继承:call()和apply()唯一区别是参数不一样,call()是apply()的语法糖:bind() ...
- 假设高度已知,请写出三栏布局,其中左右各为300px 中间自适用
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- HTML实例之搜索栏(附源码)
1. 简书类 实现效果 html代码 <div class="container"> <form action="" class=" ...
- 百度地图API----搜索地址,获取该点的位置坐标并转换成WebMercator
function doFind(){ LoadBaiduMapScript().then(BaiduMap).then(function () { //查询并获取坐标 var myGeo = new ...
- 【转载】Android绘图之Path总结
Path作为Android中一种相对复杂的绘图方式,官方文档中的有些解释并不是很好理解,这里作一个相对全面一些的总结,供日后查看,也分享给大家,共同进步. 1.基本绘图方法 addArc(RectF ...
- linux 下使用 tc 模拟网络延迟和丢包-使用 linux 模拟广域网延迟 - Emulating wide area network delays with Linux
tc 是linux 内置的命令:使用man pages 查看 我们看到,其功能为 show / manipulate traffic control settings,可对操作系统进行流量控制: ne ...
- layUI学习第二日:非模块化方法使用layUI
layUI采用非模块化方式(即所有模块一次性加载),操作示例代码如下(如果问怎么创建项目和工具,参考layUI学习第一日的步骤): 运行的结果如下: 运行的显示不会太持久,过几秒就会消失,具体封装的代 ...
- LG2145 「JSOI2007」祖码 区间DP
问题描述 LG2145 题解 把颜色相同的一段看做一个点. 然后类似于合唱队区间DP即可. 但是这题好像出过一些情况,导致我包括题解区所有人需要特判最后一个点. \(\mathrm{Code}\) # ...