CSS vs. JS Which code runs faster?

I have a website - bit.ly/1qdNJJs
Working in HTML\CSS without JS
It makes sense to write sliders\menus etc in JS? If it is possible in CSS!
Explain to the fool :)
July 9th 19 at 10:33
6 answers
July 9th 19 at 10:39
July 9th 19 at 10:35
depends on whether you're awake to write native js to use that. For example, there is such a thing as velocity js, it works much faster and smoother than jquery animate or css and the load on the fps much less. Even on Habre there was article now I will try to find
No. In these things there is no magic. Velocity, like in any normal liberal to the animation under the hood yuzaetsya requestAnimationFrame and setInterval not like the old jQuery (3 versions of jQ have also rAF will). ZHS animation at KCC performance can not win. But ZHS animation is better for complicated things, because it's not declarative + there is a possibility of animation of a plurality of properties of the transforms simultaneously with different isingame and durations due to the dynamic preumnozhenija matrices, while in css, everything is limited to one multiplied the matrix in the transform property. Velocity is generally better forget juzat need GSAP. - jacky_Murazik commented on July 9th 19 at 10:38
,
tell me, please, where you can read / view about the "matrix" of which you wrote? or explain, if possible, in a nutshell.

1. I just do not understand why "the matrix", it has something to do with the same data structure?

2. For example, do I understand correctly that you mean that js has the ability to run multiple keyframes (if roughly speaking), at that time, as the CSS - only serial execution? - Braden_Stiedemann53 commented on July 9th 19 at 10:41
July 9th 19 at 10:37
Sliders is still better on the JS is much easier, more flexible and upravlyaemoe.
Plus lots of ready made libraries (which under the hood can partially use CSS animations).
If used in moderation, performance will be all right.
July 9th 19 at 10:41
If the site for yourself - write as you like.
If under the order - use for speakers js and css for static. Otherwise, the customer can make claims about the sustainability of the site.
But I never thought of that. thanks! - jacky_Murazik commented on July 9th 19 at 10:44
July 9th 19 at 10:43
Given that css works at all, and sometimes turn off js. I think it is reasonable to do so:
all that is possible to write in css, the rest in js, although frankly I think those who turn off js in the browser - oligophrenia, and they are not the target audience of most sites.
CSS works at all, but the slider on css or animation, not all will work. Animate svg path may not even ie11, not to mention ie9 - jacky_Murazik commented on July 9th 19 at 10:46
: Naturally. - Braden_Stiedemann53 commented on July 9th 19 at 10:49
July 9th 19 at 10:45
If we are talking about such a primitive site, no difference.

Find more questions by tags CSSHTMLJavaScript