Dan*_*eld 5 css ios css-animations
我知道不可动画的属性不会在动画中插入,但是,我的理解是这些值至少是(突然)计算的。
因此,例如,假设我想将溢出属性(不可设置动画,即不在此列表中)从hiddento设置为“动画” visible- 我希望计算出的值会适当更改。
(我尝试在规范中查找此内容,但找不到明确提及的内容)
这实际上发生在 Chrome 和 Firefox 中,但不是在 iOS 上。(Safari、iPhone)
.animate {
border: 5px solid green;
width: 200px;
height: 100px;
animation: 3s resetOverflow;
}
@keyframes resetOverflow {
from {
overflow: hidden;
color: red;
}
to {
overflow: visible;
color: green;
}
}Run Code Online (Sandbox Code Playgroud)
<div class="animate">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in </div>Run Code Online (Sandbox Code Playgroud)
请注意,在 Chrome 和 Firefox 上,溢出的值从隐藏变为可见,但在iOS上,溢出的值似乎被完全忽略了——保持其默认值可见。
1) 我为颜色添加了动画只是为了表明可动画属性在 iOS中运行良好
2)iOS 似乎确实忽略了所有不可设置动画的属性(不仅仅是溢出) - 这是另一个尝试为position属性设置动画的演示。
3)我知道这可以用 javascript - demo来完成……但我想用 CSS 来做到这一点。
这是iOS中的错误吗?任何解决方法?
尝试按照以下答案应用浏览器前缀:
.animate {
border: 5px solid green;
width: 200px;
height: 100px;
-webkit-animation: 3s resetOverflow;
animation: 3s resetOverflow;
}
@-webkit-keyframes resetOverflow {
from {
overflow: hidden;
color: red;
}
to {
overflow: visible;
color: green;
}
}
@keyframes resetOverflow {
from {
overflow: hidden;
color: red;
}
to {
overflow: visible;
color: green;
}
}Run Code Online (Sandbox Code Playgroud)
<div class="animate">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has
survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in </div>Run Code Online (Sandbox Code Playgroud)