0

With jQuery .animate(), I use to write like .animate({ 'font-size': "24px", 'color': '#555' }, 1000 ) to animate the item as per the CSS attributes.

Is there a way in which I write a css class

.className{
    font-size : "24px";
    color : "#333";
}

and use that class to perform the .animate() function so that I don't have to write all the CSS attributes as the properties of the jquery .animate() function??

1 Answer 1

2

It's not "vanilla" jQuery, but jQuery UI has animation for addClass (plus toggle, switch, and remove).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.