Is it better to implement the function using the number of CSS code n * 10 instead of n number of code in js? What is preferable from the load on the browser, the quality of the code, the level maker-up?

Closed due to the fact that the issue is too common for participants Vlad from Moscow , Vadim Ovchinnikov , Kromster , user194374, AK 12 Jan '17 at 7:45 .

Please correct the question so that it describes the specific problem with sufficient detail to determine the appropriate answer. Do not ask a few questions at once. See “How to ask a good question?” For clarification. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • Here you need to look at the situation in which you want to apply it - Yuri
  • I think strongly from business to applications will depend. Try, test (benchmark), share the result :). - E_p

1 answer 1

All that is done with the help of css, provided that css is directly intended for this (well, for example, this is NOT the implementation of tabs on css) should be done on css.

If absolutely nothing, then js. But most likely there will emerge problems with dynamic content formation, window resizing and other things, when the css browser recounts itself, and js in general does not know that it would be necessary to recalculate.

But non-visual user interaction on css instead of js is not necessary. Any clicks on buttons, tabs and other reactions to events in most cases should be on js.