Jump to content
Search Community

Scrolltrigger on mobile is jerky

jored test
Moderator Tag

Recommended Posts

I solved like that but I am not sure that it is the best practice if someone has a better idea:

 

Quote

  gsap.registerPlugin(ScrollTrigger);
  let tl = null;
  let mm = gsap.matchMedia();
  mm.add("(min-width: 768px)", () => {
    tl = gsap.timeline({
      scrollTrigger: {
        trigger: ".scene",
        start: "top 3%",
        end: "bottom -100%",
        scrub: 1.5,
        pin: true
      },
    });
  });
  mm.add("(max-width: 768px)", () => {
    tl = gsap.timeline({
      scrollTrigger: {
        trigger: ".scene",
        start: "top 3%",
        end: "+=1000",
        scrub: 1,
        pin: '.viewer',
        toggleActions: "play none none reverse",
      },
    });   
  });

 

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...