- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我已经为某个 div 设置了动画。
.Animation
{
-webkit-animation-fill-mode: both; /*and also -moz, -ms etc. */
animation-fill-mode: both;
-webkit-animation-delay: 1s;
animation-delay: 1s;
-webkit-animation-duration: 2s;
animation-duration: 2s;
}
@-webkit-keyframes scaleAnimation /*and also -moz, -ms etc. */
{
0%
{
opacity: 0;
-webkit-transform: scale(2);
}
100%
{
opacity: 1;
-webkit-transform: scale(1);
}
}
.ScaleAnimation
{
-webkit-animation-name: scaleAnimation; /*and also -moz, -ms etc. */
animation-name: scaleAnimation;
}
但我想要一个不同的自定义缓动(立方贝塞尔曲线)用于不透明度和另一个自定义缓动用于变换。我该如何让它发挥作用。
以下无效:
transition: opacity 1s ease-in-out;
transition: scale 1s ease-in-out;
所以它肯定不适用于自定义缓动,cubic-bezier(0.555, -0.130, 0.270, 1.075);例如。
有什么想法吗? :)
最佳答案
对于转换,您可以通过逗号分隔来指定多个转换。
transition: <duration> <property> <delay> <timing-function>, ....
transition: 1s opacity 1s ease-in-out, 1s scale 1s linear;
如果您想走动画/关键帧路线,那么您可以创建两个动画关键帧。一个用于缩放,另一个用于不透明度。然后在元素的动画设置中用逗号分隔它们。
缓动的属性是animation-timing-function
。对于基于 webkit 的浏览器(从您的问题看来,您不介意供应商前缀),它变为 -webkit-animation-timing-function
。
您可以像这样设置它:
div {
width: 120px; height: 120px;
background-color: red;
display: inline-block;
}
div.d1 {
-webkit-animation-fill-mode: both;
-webkit-animation-delay: 2s, 2s;
-webkit-animation-duration: 2s, 2s;
-webkit-animation-name: scaleAnimation, opacityAnimation;
-webkit-animation-timing-function:
cubic-bezier(0.1, 0.7, 1.0, 0.1), ease-in;
}
div.d2 {
-webkit-animation-fill-mode: both;
-webkit-animation-delay: 2s, 2s;
-webkit-animation-duration: 2s, 2s;
-webkit-animation-name: scaleAnimation, opacityAnimation;
-webkit-animation-timing-function: linear linear;
}
@-webkit-keyframes scaleAnimation {
0% {
-webkit-transform: scale(2);
}
100% {
-webkit-transform: scale(1);
}
}
@-webkit-keyframes opacityAnimation {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
<div class="d1">D1</div>
<div class="d2">D2</div>
fiddle :http://jsfiddle.net/abhitalks/3y7pcd1t/1/
.
关于html - 不同属性的 CSS3 不同自定义缓动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27039565/
我有一个 RelativeLayout,我从 drawable 设置了背景。我能够将 RelativeLayout 的背景更改为另一个RadioButton 被选中。但是当它发生变化时我该如何给它一个
我正在尝试在 Google 的 Play 报亭应用中复制此动画: http://i.imgur.com/UuX1PRO.webm 我的布局看起来像这样: ... more
我一直在评估 Airflow 。我有一个用例,我有一个每小时运行一次的工作流,以获得每小时的数据聚合。另一个每天运行以获得相同的每日聚合。是否可以创建一个组合工作流,其中仅当所有小时聚合在过去一天都成
我有下一个结构: Activity 1: Activity 2: Form to add new item to the recycler View. RecyclerView
我只是想知道 JavaFx 中是否有任何简单的动 Canvas 局方法,例如 VBox 和 HBox。我希望我的应用程序在指定时间后更改 VBox 的背景颜色。但我意识到没有任何类似于 FillTra
我正在使用 Angular 4 动画在按钮上测试一个简单的淡入/淡出动画。我遇到的问题是,因为我使用的是 bool 值,所以没有任何东西被触发。从开发工具来看,它看起来像一个 .ng-animatin
有没有人在 SublimeREPL 中使用 irb 交换 pry 有任何运气?我很接近,我想。我没有收到错误,但是当我输入命令时也没有收到响应。每次我点击返回时,它的行为就像缓冲区被重置一样。 我正在
今天要向小伙伴们介绍的是一个能够快速地把数据制作成可视化、交互页面的 Python 框架:Streamlit,分分钟让你的数据动起来! 犹记得我在做机器学习和数据分析方面的毕设时,
简而言之,我想缩放 View - 就像 Android Market 一样,当您单击“更多”按钮时,例如在“描述”上。 我发现,Android Market 具有以下结构的布局: > 64d
我似乎无法让它工作。 我正在尝试每天发送一个给定的文件,其名称类似于“file_{{ds_nodash}}.csv”。 问题是我似乎无法将此名称添加为文件名,因为它似乎无法使用。在电子邮件的正文或主题
当您调整窗口大小时, float 的 div 将按预期换行到下一行。但我真的很希望这种布局变化是动画化的。 编辑:顺便说一句,找到一个不依赖于 JQuery 的解决方案会很好。如果需要,我不介意编写自
我有一个复杂的数据处理管道,目前在单台机器上用 Python 实现。 管道是围绕处理属于一系列实现文档、页面、单词等的自定义类的对象而构建的。该管道中的大多数操作都是令人尴尬地并行的——它们处理单个文
我是一名优秀的程序员,十分优秀!