D
D
Dmitry2016-10-28 10:12:46
css
Dmitry, 2016-10-28 10:12:46

What is better to use, css animation or jQuery animation?

I asked myself such a question. What is the best way to make animation on the pages? You can add a class to the element through jq and describe the animation itself in css. And you can do it right in jq. So I don’t know how it’s better in terms of clean and understandable code, cross-browser compatibility, and common sense.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
D
Dima Pautov, 2016-10-28
@bootd

CSS, if animations need to somehow change dynamically, then jq plugins can be used to create animations. They all do css3 animations

D
Dmitry Klusevich, 2016-10-28
@dimka-dooz

The point is that both approaches have drawbacks. Css is more productive and does not load the system, but at the same time less flexible in use, js beats performance, but at the same time you can do more specific things + support for older browsers is better. The choice must be according to circumstances. There is already a new feature for animation that combines 2 approaches, js flexibility and css performance - Web animation api, but its support is still lame, although there are adequate polyfills.

N
Nicholas, 2016-10-28
@healqq

1. Animations on jq - always not. Otherwise, it all depends on the complexity of the animations: if these are ui-effects, then adding classes is enough, if these are some kind of false animations (for example, 3D transforms), then requestAnimationFrame is in your hands.

D
devstudent, 2016-10-28
@devstudent

it is more convenient to change classes and describe animation in them, in every sense it is more convenient

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question