3 ms·
No need to over complicate things by adding an unnecessary library? I'm sympathetic to jQuery users and I think it's a phenomenal artifact in the history of th
by nkozyra 7y ago
No need to over complicate things by adding an unnecessary library?
I'm sympathetic to jQuery users and I think it's a phenomenal artifact in the history of the early web but unless you need to accommodate IE9 I don't know why you'd want to use it for a widget like this.
- rajangdavis 7y agoIt's using some animation sugar from jQuery (source is in this blogpost: https://app.trevor.io/public/blog/demo https://app.trevor.io/public/blog/demo). It might be possible to port most stuff over to ES6 and use CSS animations; however, the code is concise and readable.
- nkozyra 7y agoI'm not arguing against jQuery in the abstract, but you can write concise readable vanilla js/css with animations. I've used jQuery recently because I had to target older browsers, but if you don't it's almost always cleaner and lighter weight to use modern J's.
- rajangdavis 7y agoHonestly, my first thought was to port the code to ES6/CSS3 because I also share the belief that the code can be as concise if not moreso; however, I still think what the author did was a good solution. I think the tradeoff is if you want to delegate everything (animations and DOM manipulation) to one language using a single library or split things up into two languages with no libraries. I prefer splitting things between JS and CSS, but I'm impressed with how clever, concise, and expressive using jQuery can be.
- tagspace 7y agoYeah, true. Maybe we'll try and port this to CSS animations at some point.