- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在尝试获取开圈的值。
这意味着在第一次开始时,让我们假设开放空间指向底部,然后当搜索完成时。它应该隐藏并在下次有人要在同一开放位置上搜索某物时出现。 “在我们现在的例子中,指向底部而不是从初始值开始,指向顶部”
我知道 CSS 不能记住东西,所以应该用 JavaScript 来完成。
它必须与 IE 10 兼容。
蓝圈开仓位置要保存起来,以备下次搜索
.i-map-loading {
display: none;
color: #0067b1;
background-color: transparent;
font-size: 2.5em;
text-align: center;
text-shadow: 0 0 5px white;
animation-name: spin;
animation-duration: 3000ms;
animation-iteration-count: infinite;
animation-timing-function: linear;
}
@keyframes spin {
from {
transform:rotate(0deg);
}
to {
transform:rotate(360deg);
}
}
最佳答案
CSS 确实会记住东西,而且你有能力 pause your animation直接来自 CSS:
.i-map-loading {
/* I borrow the stylings from Temani's answer */
display: inline-block;
width: 50px;
height: 50px;
margin: 5px;
border: 5px solid;
border-left-color: yellow;
border-radius: 50%;
animation-name: spin;
animation-duration: 3000ms;
animation-iteration-count: infinite;
animation-timing-function: linear;
/* by default paused */
animation-play-state: paused;
}
:checked ~ .i-map-loading {
animation-play-state: running;
}
@keyframes spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
<input type="checkbox" id="check">
<label for="check">toggle animation</label><br>
<div class="i-map-loading"></div>
但是,只要您的元素在 CSSOM 中,它就会记住一些东西,并且设置 display: none;
会从中删除您的元素及其所有子元素那里。
所以你需要另一种方式来隐藏你的元素:
.i-map-loading {
display: inline-block;
width: 50px;
height: 50px;
margin: 5px;
border: 5px solid;
border-left-color: yellow;
border-radius: 50%;
animation-name: spin;
animation-duration: 3000ms;
animation-iteration-count: infinite;
animation-timing-function: linear;
/* by default hidden, but not with display:none */
visibility: hidden;
position: absolute; /* if you need it to be removed from the page flow */
/* by default paused */
animation-play-state: paused;
}
:checked ~ .i-map-loading {
visibility: visible;
position: static;
animation-play-state: running;
}
@keyframes spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
<input type="checkbox" id="check">
<label for="check">toggle animation</label><br>
<div class="i-map-loading"></div>
关于javascript - 如何设置和获取加载圆圈@keyframe 的值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58695092/
这是在 Chrome 中不是由 orbit 动画的圆圈。 http://jsfiddle.net/ztkav838/ //CSS @-webkit-keyframes orbit { from
我一直在查看示例,但我在这里遗漏了一些东西。我无法启动这个简单的 css 动画,改变某些文本的颜色。当我运行下面的示例时,文本保持黑色。 我有一个名为“changeColor”的动画,应用于 h1 元
我一直在浏览示例,但我会在这里遗漏一些东西。我无法触发这个简单的 css 动画,改变一些文本的颜色。当我运行下面的示例时,文本保持黑色。 我有一个名为“changeColor”的动画,应用于 h1 元
我想在第二次点击按钮时重复@keyframne 动画,但它只生效一次。 $(document).ready(function(){ $('#btn_c
我在@keyframes 动画中缩放文本,当文本增加时,它变得模糊,我该如何防止? JS Bin Example 谢谢! 最佳答案 解决问题的最简单方法是将最大状态比例设置为 1,将较小状态比例设置为
我正在尝试创建一个关键帧,它会在查看几秒钟后更改 div 容器的内容,但它不起作用。 这是我的代码: @-webkit-keyframes k_home_projectSlider { 0%
当我创建 @keyframes 动画并将其分配给悬停时的图像时,它会随机闪烁。正如您在 GIF 中看到的那样,它只能随机地正常工作几次。 我已经尝试了以下所有方法并为每个供应商添加了前缀: 背面可见性
我有一个 css3 @keyframe 动画,我在控制时遇到了一些麻烦。 这是一个分为两部分的动画,有一个平放的高矩形,在第一部分中它假设旋转 90 度并将 z 轴向上平移向您同时也向左平移,然后完成
是否可以减少代码以生成一组可以处理各种浏览器前缀的混合宏? 尝试减少代码长度以使用更多mixin 所以代替 @-moz-keyframes orbit { 0% { opaci
我正在尝试使用 @keyframes 制作动画。但是,该示例不起作用。 .main{ width:100%; height:500px; border: 1px solid black; } @
所以我正在制作一个简单的元素,它会显示一个计时器并仅使用 HTML 和 CSS 计数到 99。 但是有人能告诉我为什么我需要延迟我的 100 秒动画以使其与 10 秒动画同步吗? .second::b
我有四个动画 div 元素,它们在 section 元素内旋转。 div 元素需要放在文本下方(假设它有背景),这样就不会出现冲突线,所以我尝试做的是添加 background-color: #aea
不确定我在这里面对的是什么,但我正在尝试应用 CSS 动画。 经过一些研究,我认为添加 webkit 前缀将有助于解决问题,但看起来我仍然面临读取无效属性值的问题。 这是我当前的代码: .progre
我试图让动画在悬停后缓和到元素的原始值。动画本身工作正常,但是当我将鼠标悬停在该元素上时,它会立即恢复到原始状态,而我希望有 0.2 秒的缓和。有什么帮助吗? 这是我的代码: img.footer {
.car1 仅在使用 @keyframes 的 from 和 to 时移动,但在使用时不移动%。谁能解释为什么会这样? .car1 { animation: car1 2s 2 forwards;
似乎无法让我的图像 slider 工作,我打算将其用作我的页面的标题,但图像不会滑动。我已经尝试过 chrome 的前缀,但它们没有任何区别。 这是C
我正在尝试做的事情:我在黑盒子里有链接。我试图在悬停时使框的背景从黑色变为蓝色。我不知道该怎么做。这是我的 CSS(我将它设置为 5s 但我真的希望它在悬停时生效) @keyframes navBox
我试图用 CSS3 使我的 div 上下移动,但它没有 @-webkit-keyframes mover { 0%, 100% { top: 0%;} 50% { top: 5%;
我正在尝试编写此文本动画效果 ( please see video ),但我离解决方案还很远!! 你能帮帮我吗?也许使用 js 更好? h1.fadeinone { animation: fadein
这个问题在这里已经有了答案: Using percentage values with background-position on a linear-gradient (2 个答案) 关闭 3
我是一名优秀的程序员,十分优秀!