我正在尝试在我的网站here中滚动添加动画。我使用了animate css和scroll out js。我的JavaScript是,
<script>
ScrollOut({
targets: '.aos',
onShown: function(el) {
// remove the class
el.classList.remove("animated", "fadeIn");
// force reflow
void el.offsetWidth;
// re-add the animated cl
el.classList.add("animated", "fadeIn");
}
});
</script>
我在页面中使用了<div class="aos animated fadeIn slow"></div>
。
然后,它也可以在所有dektop浏览器和移动Firefox中使用,但仅在移动chrome中的动画之前会闪烁。
我试图将style="-webkit-transform: translate3d(0,0,0);"
添加到div元素,但是不起作用。