@keyframes marquee2 {}
无法在Internet Explorer 11上运行,也无法在Edge上完美运行。所有其他主流浏览器,如Firefox或Chrome都运行良好。还是不知道打破动画的原因是什么。将left
与transform: translate(0, 0)
一起使用时,为什么动画无效?
演示:https://codepen.io/athimannil/full/bojLQN
body {
min-height: 100vh;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
}
.container {
width: 90vw;
}
.container {
overflow: hidden;
position: relative;
height: 200px;
}
.marquee-wrap {
position: absolute;
display: -webkit-inline-box;
display: -ms-inline-flexbox;
display: inline-flex;
-webkit-animation: marquee2 20s linear infinite;
animation: marquee2 20s linear infinite;
}
.marquee-wrap .marquee-img {
width: 200px;
padding: 0 1rem;
}
.marquee-wrap .marquee-img img {
max-width: 100%;
}
@-webkit-keyframes marquee2 {
0% {
left: 0;
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
50% {
left: 100%;
-webkit-transform: translate(-100%, 0);
transform: translate(-100%, 0);
}
100% {
left: 0;
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
}
@keyframes marquee2 {
0% {
left: 0;
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
50% {
left: 100%;
-webkit-transform: translate(-100%, 0);
transform: translate(-100%, 0);
}
100% {
left: 0;
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
}

<div class="container">
<div class="marquee-wrap">
<div class="marquee-img"><img src="http://via.placeholder.com/200x200?text=Logo 01" alt=""></div>
<div class="marquee-img"><img src="http://via.placeholder.com/200x200?text=Logo 02" alt=""></div>
<div class="marquee-img"><img src="http://via.placeholder.com/200x200?text=Logo 03" alt=""></div>
<div class="marquee-img"><img src="http://via.placeholder.com/200x200?text=Logo 04" alt=""></div>
<div class="marquee-img"><img src="http://via.placeholder.com/200x200?text=Logo 05" alt=""></div>
<div class="marquee-img"><img src="http://via.placeholder.com/200x200?text=Logo 06" alt=""></div>
<div class="marquee-img"><img src="http://via.placeholder.com/200x200?text=Logo 07" alt=""></div>
<div class="marquee-img"><img src="http://via.placeholder.com/200x200?text=Logo 08" alt=""></div>
<div class="marquee-img"><img src="http://via.placeholder.com/200x200?text=Logo 09" alt=""></div>
<div class="marquee-img"><img src="http://via.placeholder.com/200x200?text=Logo 10" alt=""></div>
</div>
</div>
&#13;
答案 0 :(得分:0)
不幸的是,或者更确切地说,我没有IE 11或Edge进行测试,但caniuse.com的这些要点可能会导致您的问题