juliangarnier / anime

JavaScript animation engine

Home Page:https://animejs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

docodev opened this issue · comments

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.

commented

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,
});

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