Earlier quoted context omitted.
> Ah! Also, nobody cares about unobtrusive JavaScript anymore. I do. I also care about graceful degradation. There are certain times (e.g. Web Apps like Gmail) where graceful degradation is almost impossible and unobtrusive JavaScript would be silly but those are the exception. Most sites on the web are just content and there's no reason to have excessive JavaScript or any reason why the page can't be perfectly funct…
Just because something can be done a certain way doesn't mean it should be done a certain way. Minimizing javascript for the sake of minimizing it is silly. People that disable javascript represent a tiny percentage of the population. No one is going to make engineering decisions based on that tiny percentage, anymore than people still target IE6.
CSS is powerful, you can do a lot of things without JS
221–230 of 319 posts
Re: CSS is powerful, you can do a lot of things without JS
#222Earlier quoted context omitted.
That's fine. Nobody forces you to use my applications and websites.
Until you work for a government agency. Or the only supplier of a certain important service in an area. Etc.
And no, I'm not making this up.
Re: CSS is powerful, you can do a lot of things without JS
#223Earlier quoted context omitted.
Is jQuery included in those 4 or 5 lines? One line of CSS in your accordion?
If you had read the next sentence of my comments you would have seen that it would be a "few more lines" if you didn't use jQuery, basically you need a function like: function eachItem(arrayLike, cb) { return [].slice.call(arrayLike).forEach(cb); } So 3 more lines. If I said you can write a very verbose accordion in under 20 lines would that be good enough for you?
Since that's more realistic, yes that would do nicely.
Re: CSS is powerful, you can do a lot of things without JS
#224Earlier quoted context omitted.
I'm interested in seeing these 3 lines of Javascript that can implement an accordion. With a sane limit to number of characters on each line as well.
If one is already using jQuery - https://jsfiddle.net/jw75xznb/ Yeah, it's incredibly crude but it is 3 lines and it took approximately 60 seconds.
Re: CSS is powerful, you can do a lot of things without JS
#225Earlier quoted context omitted.
If one is already using jQuery - https://jsfiddle.net/jw75xznb/ Yeah, it's incredibly crude but it is 3 lines and it took approximately 60 seconds.
If it involves jQuery then it is not 3 lines. The original claim was 3 lines of Javascript. Making a claim something is only 3 lines of Javascript without including the fact that jQuery is required is a disservice to the many people that made jQuery the wonderful library that it is. That is the source of my disagreement.
Re: CSS is powerful, you can do a lot of things without JS
#226Re: CSS is powerful, you can do a lot of things without JS
#227Earlier quoted context omitted.
There's a lot more to this than just "a little delay" to avoid accidental triggers. Good menus are complex. In desktop toolkits, there is a lot of logic to ensure they are accessible and don't behave in annoying ways. For example, a high quality menu will have a certain leeway to trigger into and out of submenus so that you don't accidentally drift into the incorrect submenu should you make an error of a couple of pi…
Good points, but surely all that knowledge could be encoded once into some CSS attributes, rather then rewritten every time for every JavaScript framework on every site?
Re: CSS is powerful, you can do a lot of things without JS
#228Earlier quoted context omitted.
If one is already using jQuery - https://jsfiddle.net/jw75xznb/ Yeah, it's incredibly crude but it is 3 lines and it took approximately 60 seconds.
If it involves jQuery then it is not 3 lines. The original claim was 3 lines of Javascript. Making a claim something is only 3 lines of Javascript without including the fact that jQuery is required is a disservice to the many people that made jQuery the wonderful library that it is. That is the source of my disagreement.
Re: CSS is powerful, you can do a lot of things without JS
#229Re: CSS is powerful, you can do a lot of things without JS
#230Related, does anyone else have a preferred pure css treeview?
Also, keyboard support would be great. And if it wouldn't overflow offscreen.
Oh wait, no such thing.
(Note that these are basic issues, not arcane requests for 9-bit EBCDIC compatibility - but nooooo: let the users suffer, because we want to use this extra-cool trick)