+ 1

CSS3 vs JS

Why should we use js, if we can make things interactive with css3... Like animation and all... Except for event handling what are the other purpose of js...? ANIMATIONS is cool in css3... At least cooler than js... As far as i knoe... Still please help.!

9th Jul 2017, 7:37 AM
Anshul Garg
Anshul Garg - avatar
6 ответов
+ 4
Css animation (and transition) features are mostly powerful, but are still limited: JS is more best suited for complex animation and/or interractivity... Anyway, it's totally right that if you can do something with Css rather than with JS, it will be better to handle it with Css (independant execution from JS scripts, less code to produce generally and cpu ressources less busy for rest of your JS code) ^^
9th Jul 2017, 10:56 AM
visph
visph - avatar
+ 4
Css cannot really handle dynamicaly animation (for example, you cannot animate an element with some value set by user): that's this kind of animation I qualified of 'complex'... On the other hand, it could becomes very verbose to define complex animation in sense of many key images (fixed values for properties at specific instant on a timeline) Finally, Css animations are also limited by the fact that almost css properties are animatable, but not all... and you cannot animate with Css what you cannot define by Css ^^
9th Jul 2017, 6:56 PM
visph
visph - avatar
+ 1
JS is a programming language. You will have to work with functions, conditions, objects and events to make a page interactive... I'm affraid you didn't understand
9th Jul 2017, 7:43 AM
Ledio Deda
Ledio Deda - avatar
+ 1
JS is so boring kind of now...creativity... 🙁... Css is better... In all repaect... Perhaps css have some logic handlings feetures i would have never userd js...
9th Jul 2017, 7:59 AM
Anshul Garg
Anshul Garg - avatar
+ 1
I understand what you are saying. Maybe you think JS except boring, is more complicated and somehow you are right. But if you want to become a web developer you will definitely need JS...
9th Jul 2017, 8:11 AM
Ledio Deda
Ledio Deda - avatar
0
@vishp complexity in animation example?...plz id any... And yes it will be great help if anyone can explain limitedness of css... Quoting example
9th Jul 2017, 3:23 PM
Anshul Garg
Anshul Garg - avatar