In terms of performance and the speed loading the files for a browser, would it be better to use media queries to change a few things, or make a JQuery function that reads the screen size and change items using .CSS()?
-
I think you find the better description here.. https://stackoverflow.com/questions/16675952/performance-pure-css-vs-jquery – Razib Hossain Dec 07 '18 at 05:55
2 Answers
In my opinion, current browser already have great support of css3. That's mean you almost can do anything related 'responsive' styling using css3 (such as media query, translatex, scale ttc)
A long time a go, people like me, are using jquery to center a div in vertical responsive way, no matter you resize the browser size the content should be in vertical center. Yes im using jquery that time, but just Because im forced to. And the drawback is, user see the content not in center vertical after the browser finish loading, because the js only invoked later in a while after loading.
Nowdays you can simply doing that using css3. And user will see the center vertical content right away as soon the browser finish loading
So the summary, in my opinion to use css3 as much as you can, because it faster and rendered before the browser finish the loading.
And only using jquery if you forced to. Again this is my opinion, i hopefully this help you in some way.
Have a nice day

- 341
- 1
- 6
Paul Lewis has a great article on rendering performance here: https://developers.google.com/web/fundamentals/performance/rendering/
In general, CSS is faster because it's farther down the pipeline than javascript.

- 2,583
- 3
- 19
- 24