Paweł Czekaj
Paweł Czekaj

Reputation: 63

Gsap Scrolltrigger not detected

Hi for some reason gsap doesn't execute scroll trigger at all ( doesn't show markers ) instead goes str8 for the " y animation", any idea what can be wrong?

gsap.registerPlugin(ScrollTrigger);

const fixedMenu = () => {
    let m = document.querySelector('header');
    const mc = document.querySelector('.main-content');
    gsap.to(m, {
        scrollTrigger: {
            trigger: '.main-content',
            start: 'center top',
            toggleActions: 'play none none none',
            markers: true
        },
        y: -200
    });
};

I'm using this in wordpress website, I used to do it exact same way in other site where it worked fine, for some reason it doesn not execute scroll trigger now ( checked the network, and both gsap, and gsap.scrolltrigger are loded on website )

Upvotes: 0

Views: 686

Answers (1)

Paweł Czekaj
Paweł Czekaj

Reputation: 63

Nvm, for some reason gsap.registerPlugin didn't work, when place as the first line of code it started working, strange..

Upvotes: 0

Related Questions