嗨,我正在尝试机车滚动,但无法使事件正常运行 如我的示例所示,如果它触发事件,我将尝试使用Console.log 但它没有开火。
我已经有Jquery(如果需要,则为idk),并按照他们的 文档。平滑滚动的作品希望将来在此基础上实现Gsap。
这是我的HTML示例
<div data-scroll-container id="test">
<section data-scroll-section data-scroll-call="sectionIsInView">
<h2 data-scroll class="gg">What's up?1</h2>
<p data-scroll class="gg">?</p>
</section>
这是我的脚本示例
<script>
let scroll = new LocomotiveScroll({
el: document.querySelector('[data-scroll-container]'),
smooth: true
});
scroll.on('call', func => {
function sectionIsInView() {
console.log('hi!');
}
});
</script>