Jump to content

Search In
  • More options...
Find results that contain...
Find results in...

ScrollTrigger.batch with typescript

Recommended Posts

Hello guys,


I'm trying to use ScrollTrigger.batch with typescript, but I can't set the markers nor the triggers,

when I try yo put the markers for instance it says:


Argument of type '{ onEnter: (batch: Element[]) => Tween; markers: boolean; }' is not assignable to parameter of type 'ScrollTriggerBatchVars'.
Object literal may only specify known properties, and 'markers' does not exist in type 'ScrollTriggerBatchVars'.ts(2345)

my code so far:

  gsap.set(".work", { y: 100 });
    ScrollTrigger.batch(".work", {
      onEnter: (batch) =>
        gsap.to(batch, {
          opacity: 1,
          y: 0,
          stagger: { each: 0.15, grid: [1, 3},
          overwrite: true,
        markers: true,
am I doing something wrong?
Link to comment
Share on other sites

Hey Lelc and welcome to the GreenSock forums. Markers is not a valid property of batch, so that's your issue. Otherwise you could have a ton of markers on the page and that's not helpful.

  • Like 1
Link to comment
Share on other sites

Ah ok, because I was trying the same code on codepen and there it worked fine, but it ended well at the end anyway, I just couldn't see the markers thank you 

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.