Jump to content

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

Stagger class replacement

Recommended Posts

Hi GSAP Gurus,

I am having an issue where I am trying to replace classes and it's not working.

	$(element).addClass("red").removeClass("grey"); //Works
	//Not working
  	gsap.to(element, {
    	duration: 2,
    	className: "+=red",
    	stagger: 0.5

I have provided a CodePen Demo also.

See the Pen oNXrJEN by james182 (@james182) on CodePen

Link to post
Share on other sites

Hey @james182


"We recommend animating the properties that you need animated because tweening between classes isn't very performant, are not explicit, and adding support for them takes a significant amount of kbs for how few people use them. For more information, check out this post:




Happy tweening ...


  • Like 3
Link to post
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.