Jump to content
Search Community

Stop scrollTrigger and animations when window is too small (after resize)

dr.Pxl test
Moderator Tag

Recommended Posts

Hey,

 

I am so confused and nearly at the end of my nervs after hours of trying.

 

I am not able to disable the scrollTrigger of my master TL or kill the masterTL and underlying tweens. I basically want to stop GSAP animations if the window is to small.

Maybe you guys can take a look at my code and espacially at the comments I made.

Thank you so much!
 

    var seoIntroMasterTl = gsap.timeline({
        scrollTrigger: {
            trigger: sectionHeroSeo,
            start: "top top",
            end: "bottom bottom",
            scrub: 0.2,
            pin: false,
        }
    });
    if (play === false{
        console.log(seoIntroMasterTl.scrollTrigger) //this fires at proper moment
        seoIntroMasterTl.scrollTrigger.disable(); //this doesn't work
    }
    seoIntroMasterTl.scrollTrigger.disable(); //this works
seoIntroMasterTl.add(createFadeOutUpTl(seoATFHeroContent, seoATFHeadlineGroup))
.addLabel("Macbook fly in")
.add(createScaleDownFullScreenDeviceTl(seoATFHardware, seoAtfMacbookMatrixStart, seoAtfMacbookMatrixEnd), "Macbook fly in")
.add(createFlyingScreenWindowsTl(seoAtfWindows), "Macbook fly in")
.add(createDeviceHideIntroTl(seoATFHardware, seoBenefitsIntro, yShowSeoBenefitIntroDevicePosition, yHideSeoBenefitIntroDevicePosition, yHideSeoBenefitIntroIntroPosition))
.add(seoShowBenefitsTl);
 
return seoIntroMasterTl;
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...