Jump to content
Search Community

[SOLVED] className remove existing class

venizia03 test
Moderator Tag

Recommended Posts

Hello!

 

When one of my animation runs (the sidebar menu is opening), I want to add a class name to the body tag. I use:

 

menuTl = gsap.timeline({paused: true});
menuTl.set('body', {
			className: '+=menu-open'
		});

But this does remove any existing classes. Is there something I miss?

 

Thx!

Edited by venizia03
Indicate this has been solved
Link to comment
Share on other sites

  • 1 year later...

I am facing the same issue, when I add the class to the element the class is add, but animation don't work.

 
    gsap.to(document.querySelectorAll(".prev i.animation"), {
        keyframes: [
            {
                duration: 0.2,
                x: -5,
            },
            {
                duration: 0.5,
                x: -3,
            },
            {
                duration: 0.2,
                x: -5,
            },
            {
                duration: 0.5,
                x: 0,
            },
        ],
    });
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...