为什么动画会改变 z-index?
如果您查看 jsfiddle,您会看到红色图像位于顶部,但如果注释掉动画,则蓝色图像位于顶部。即使有动画,如何才能使蓝色图像始终位于顶部?
超文本标记语言
<img class="blue" src="http://via.placeholder.com/200/0037ff">
<img class="red" src="http://via.placeholder.com/200/ff0010">
Run Code Online (Sandbox Code Playgroud)
CSS
.red {
-webkit-animation-name: red;
-webkit-animation-duration: 2s;
-webkit-animation-iteration-count: infinite;
animation-name: red;
animation-duration: 2s;
animation-iteration-count: infinite;
}
.blue {
transform: translate(30%);
}
@keyframes red {
from {
transform: translate(50%);
}
to {
transform: translate(0);
}
}
Run Code Online (Sandbox Code Playgroud)
任何帮助深表感谢!
我收到的字符串中已经有括号,需要将其解析为数组数组。此外,元素之间也没有逗号。
我收到类似的内容:
[[[a] b] c [d]]
Run Code Online (Sandbox Code Playgroud)
并且需要将其转换为:
[[['a'], 'b'], 'c', ['d']
Run Code Online (Sandbox Code Playgroud)
我试过用括号和引号替换所有括号,但这不起作用。例如:[[a] b]变成['['a'] b]
我已经尝试过JSON.parse,但在此之前我需要做一些帮助