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 ...
随机推荐
- 【朝花夕拾】Android自定义View篇之(四)自定义View的三种实现方式及自定义属性使用介绍
前言 转载请声明,转自[https://www.cnblogs.com/andy-songwei/p/10979161.html],谢谢! 尽管Android系统提供了不少控件,但是有很多酷炫效果仍然 ...
- [Spring cloud 一步步实现广告系统] 8. 检索系统配置&依赖
工作流程 项目依赖 <dependencies> <!-- hystrix 监控面板 --> <dependency> <groupId>org.spr ...
- .net core 日常学习第一篇
使用vs 2015 update3 版本,安装sdk:https://dotnet.microsoft.com/download 可以运行 .net core 1.x版 或者使用vs 2017及以上 ...
- linu运行级别
一.介绍 0:关机 1:单用户[找回丢失密码] 2:多用户状态[无网络服务] 3:多用户状态[有网络服务] 4:保留级别 5:图形界面 6:系统重启 二.命令行运行级别 比如说关机 init 0 三. ...
- flutter_inner_drawer 使用
版本: flutter_inner_drawer: "^0.2.2" github: https://github.com/Dn-a/flutter_inner_drawer 这 ...
- Cesium专栏-样条插值(平滑路径、飞行动画,源码下载)
Cesium Cesium 是一款面向三维地球和地图的,世界级的JavaScript开源产品.它提供了基于JavaScript语言的开发包,方便用户快速搭建一款零插件的虚拟地球Web应用,并在性能,精 ...
- PHP对URL进行字符串编码
urlencode($url1) urldecode($url) //对URL进行字符串编码和解码 $url1 = 'https://www.baidu.com/uploade/img/123.png ...
- 面向对象~~类的成员: 私有成员,公有成员, 实例方法, 类方法, 静态方法, 属性(property), isinstance ,issubclass, 元类(type)
一 私有成员公有成员 公有成员: 在任何地方都能访问 私有成员: 只有在类的内部才能访问 类从加载时,只要遇到类中的私有成员,都会在私有成员前面加上_类名 二 实例方法 实例方法就是类的实例能够使用的 ...
- python虚拟环境virtualenv下安装MySQL-python(1.2.3)
该文章很有用建议收藏 我们在Windows下开发python应用时,可能需要安装各种第三方模块,但如果又不想污染公共的python环境,怎么办呢?最好是在各自的 python工程中创建一个virtua ...
- 如何获取数据泵dm和dw进程的 Strace (Doc ID 1411563.1)
How To Get A Strace Of The Data Pump dm And dw Process(es) (Doc ID 1411563.1) APPLIES TO: Oracle Dat ...