是否可以在未启用滚动条的情况下使用Scrollmagic插件为元素设置动画。我为我的容器指定了100vh的高度,因此没有滚动条。有人可以帮我找到解决方案吗?我在下面给出了我的代码。
$(document).ready(function () {
// wait until window is loaded (images, links etc...)
window.onload = function () {
// Init ScrollMagic Controller
var controller = new ScrollMagic.Controller();
var tl_boat = new TimelineMax();
// Create Animation for 0.5s
var tween = tl_boat.staggerFrom('.in-ship', 1, {
opacity: 0,
x: -100,
},0.5);
// Create the Scene and trigger when visible
var scene = new ScrollMagic.Scene({
triggerElement: 'body',
duration: 500,
offset: 0,
triggerHook: "onLeave",
reverse: true,
})
.addTo(controller)
.setTween(tween)
.addIndicators(controller);
};
});