Skrollr 动画在 safari 中闪烁。我究竟做错了什么?
Skrollr animation flickering in safari. What am I doing wrong?
向下滚动图像动画时,它会在每个图像之间闪烁。当向上滚动并重新开始时,闪烁消失了。在 Chrome 和 Firefox 中运行良好。代码结构如下:
HTML
<div class="container" id="arena">
<div id="animate"
data-anchor-target="#arena"
data-smooth-scrolling="off"
>
<img class="lazy" src="img/animations/ctu_hq_animation_mb_4.0001.png" alt="" data-0-top="display:none;" data--100-top="display:block;" data--125-top="display:none;">
<img class="lazy" src="img/animations/ctu_hq_animation_mb_4.0003.png" alt="" data-0-top="display:none;" data--125-top="display:block;" data--150-top="display:none;">
<img class="lazy" src="img/animations/ctu_hq_animation_mb_4.0004.png" alt="" data-0-top="display:none;" data--150-top="display:block;" data--175-top="display:none;">
</div>
CSS:
img {
height: 500px;
width: 800px;
position: fixed;
}
#arena {
position: relative;
width: 1000px;
height: 900px;
background-size: 900px 800px;
}
#animate {
width: 850px;
height: 650px;
position: fixed;
background-size: 900px 800px;
background-repeat: no-repeat;
left: 10%;
}
已修复,img {position: fixed) 是问题所在。移除并解决问题
向下滚动图像动画时,它会在每个图像之间闪烁。当向上滚动并重新开始时,闪烁消失了。在 Chrome 和 Firefox 中运行良好。代码结构如下:
HTML
<div class="container" id="arena">
<div id="animate"
data-anchor-target="#arena"
data-smooth-scrolling="off"
>
<img class="lazy" src="img/animations/ctu_hq_animation_mb_4.0001.png" alt="" data-0-top="display:none;" data--100-top="display:block;" data--125-top="display:none;">
<img class="lazy" src="img/animations/ctu_hq_animation_mb_4.0003.png" alt="" data-0-top="display:none;" data--125-top="display:block;" data--150-top="display:none;">
<img class="lazy" src="img/animations/ctu_hq_animation_mb_4.0004.png" alt="" data-0-top="display:none;" data--150-top="display:block;" data--175-top="display:none;">
</div>
CSS:
img {
height: 500px;
width: 800px;
position: fixed;
}
#arena {
position: relative;
width: 1000px;
height: 900px;
background-size: 900px 800px;
}
#animate {
width: 850px;
height: 650px;
position: fixed;
background-size: 900px 800px;
background-repeat: no-repeat;
left: 10%;
}
已修复,img {position: fixed) 是问题所在。移除并解决问题