我正在使用 AOS 库(css 和 js),它可以帮助我创建每次用户向下滚动页面时触发的动画。我有一个问题,页面的顶部元素仅运行一次,因为 AOS 仅在向下滚动时触发它。我希望我的所有动画在每次用户向下和向上滚动时运行。我怎样才能做到呢?
这是我的问题的一个例子。
JSFiddle https://jsfiddle.net/y2s9u01c/
对于向上滚动的外观不会产生任何效果,请放置
<div class="alert kotak" data-aos="bounce">
in
<div class="wrapper">
tag
我有同样的问题,我在容器上使用了属性:
data-aos-mirror="true"
或者将其作为 init 对象中的设置传递。
AOS.init();
// You can also pass an optional settings object
// below listed default settings
AOS.init({
// Global settings:
debounceDelay: 50, // the delay on debounce used while resizing window (advanced)
// Settings that can be overridden on per-element basis, by `data-aos-*` attributes:
once: false, // whether animation should happen only once - while scrolling down
mirror: true, // whether elements should animate out while scrolling past them
});
希望对我这样的新人有所帮助。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)