Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

eslam said
PLUS
eslam said
Courses Plus Student 6,734 Points

css and js

Should i use CSS transition and transform over java script ? i mean if something can be done without java script is it a good to go option ?

2 Answers

Steven Parker
Steven Parker
231,248 Points

Assuming the effect you want can be achieved either way, a couple of reasons why CSS might be a better choice than JavaScript:

  • browsers might be configured to not execute JavaScript
  • effects performed by CSS may make better use of video hardware and be smoother looking

But there are quite a few things that can only be done in JavaScript.

Abraham Juliot
Abraham Juliot
47,353 Points

Here's an interesting case study article that goes more in depth on this subject :)