Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anyway to add static value for properties css via anime function? #856

Open
docodev opened this issue Jun 3, 2023 · 2 comments
Open

Anyway to add static value for properties css via anime function? #856

docodev opened this issue Jun 3, 2023 · 2 comments

Comments

@docodev
Copy link

docodev commented Jun 3, 2023

Hi everyone,

This library is awesome for animation. I just very excited to try it.

So today I have a problem,
in my case, I just want to add static value like url for background-image or italic for text-style, because I don't want split my object properties, It's too much objects, I swear, so anyone can help me?

Thank so you much.

@manake
Copy link

manake commented Jun 4, 2023

Please post a code example.

You can set static styles in style.css:

.box {
    opacity: 0;
    background-image: url('image.jpg');
}

And in anime.js you would only animate dynamic properties, there is no need to set static properties using anime.js:

anime({
   targets: '.box',
   opacity: 1,
});

@docodev
Copy link
Author

docodev commented Jun 4, 2023

@manake Thanks for your reply, so I think currently it's only way to add normal styles to the elements with animejs,
so I decide use .css() of jQuery and static Class css as your reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants