2 separate CSS animations

Hi Experts,

How can I have 2 separate animations, but animation b waits until a finishes?

if I need JS, thats ok, I am just changing RGB values.

Thanks,
APD TorontoSoftware DeveloperAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Leonidas DosasCommented:
Look at the following code. I change the font size of a <p> element. Initially the font-size goes up to 120px and then to 25px. To do this I put in the complete arg of the first animate function a second animate function. The second animate function triggers when the first complete.
HTML
<p class="lw">Hello Weaver!</p>

Open in new window


CSS
.lw { font-size: 60px; }

Open in new window


JQuery

$('.lw').animate({
  'font-size':120
}, 2000,function(){
  
  $('.lw').animate({'font-size':25}, 2000);
});

Open in new window


The general type of animation function is this:
$('.lw').animate(properties, duration, easing, complete);

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
PawełI Design & Develop SoftwareCommented:
What are these animations? what's the trigger for them? do they run continuously or just once?

You can 100% do them using JavaScript, but i would first investigate using CSS Animations or transitions

https://css-tricks.com/almanac/properties/t/transition/

https://www.w3schools.com/css/css3_animations.asp

if you give me a bit more info i can probably walk you through it.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
CSS

From novice to tech pro — start learning today.