locomotivemtl / locomotive-scroll

🛤 Detection of elements in viewport & smooth scrolling with parallax.
https://locomotivemtl.github.io/locomotive-scroll
MIT License
7.83k stars 1.12k forks source link

Scroll.on is not a function #526

Open Gagan-deepp opened 10 months ago

Gagan-deepp commented 10 months ago

heyy i am trying to implement loco scroll and gsap scrolltrigger .Can anyone help me in this why I am getting the error lcoscroll.on isnot a dunction.

here is my code:

const locoScroll = new LocomotiveScroll({
        el: document.querySelector('.main'),
        smooth: true,
    });

    locoScroll.on("scroll", ScrollTrigger.update());
GanatraJay2000 commented 2 months ago

Hi @Gagan-deepp, did you find a solution?

jwinr commented 1 week ago

Need more context here. Doesn't seem to be an issue with locomotive scroll. Initializing it as locoScroll and calling locoScroll.on("scroll", locoScroll.update()); doesn't produce any errors.

Works with the following versions: locomotive-scroll: 4.1.4 next: 14.2.10 react: 18