And here I am, trying for past 10 years to centre align a div, both horizontally and vertically.
You took the words right out of my mouth(fingers). Was just thinking the exact same thing
CSS is powerful, you can do a lot of things without JS
211–220 of 319 posts
Re: CSS is powerful, you can do a lot of things without JS
#212Earlier quoted context omitted.
With jQuery it's probably like 4 or 5 lines. With plain JS a few more as you have to write your own iterator function. All an accordion does is add an event listener that removes a class from all elements and adds it back to one of them. Then there's a 1 line transition for that class in css.
Is jQuery included in those 4 or 5 lines? One line of CSS in your accordion?
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?Re: CSS is powerful, you can do a lot of things without JS
#213Earlier quoted context omitted.
My current-favorite problem with modern web development is mobile-specific redirection. e.g. you click a link in your email and it takes you to "www.foo.com/somethingWithParametersAndImportantStuff", foo.com detects you're on a phone and redirects you to their mobile homepage at "m.foo.com", blowing away your URL or even better not supporting your particular URL's page in the mobile site... where... your mobile brows…
http://xkcd.com/869/ Anyone know where I can find publication dates for individual comics? I don't see anything on the comic's page.
This comic was March 7, 2011.
http://www.explainxkcd.com/wiki/index.php/869:_Server_Attent...
Re: CSS is powerful, you can do a lot of things without JS
#214Re: CSS is powerful, you can do a lot of things without JS
#215I've worked with people who did things like this. It's not fun for anyone else on the team to try and figure out why you're using specific pseudo selectors on tags in a child inside a sibling in some label to make an accordion that would take 3 lines in Javascript.
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.
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
#216Earlier quoted context omitted.
I'm very curious about this: is there a hypothesis that non-mobile computers are going away in the business world and/or that "young people" will not be involved in that world? I don't know the stats - are tablets making big inroads in business computing?
Dunno. But my niece and nephew are tablet/phone experts, and have never used a mouse. And they are 4 and 6.
Re: CSS is powerful, you can do a lot of things without JS
#217Earlier quoted context omitted.
Digression: 'clicking on a link' may become an obscure reference soon, like dialing a phone. How many young people ever use a mouse?
I'm very curious about this: is there a hypothesis that non-mobile computers are going away in the business world and/or that "young people" will not be involved in that world? I don't know the stats - are tablets making big inroads in business computing?
Re: CSS is powerful, you can do a lot of things without JS
#218Earlier quoted context omitted.
> Browsers/webapps have only become this crazily successful because they allow seamless delivery of applications to run locally. I'm going to heavily disagree with you. There were plenty of sites that were successful without using heavy JS. Most webapps I see can run easily without JS, they just choose not to. Yes, there are exceptions, but they are exceptions. "The core features people want" aren't JS-pop-ups, and s…
> They want sites that work quickly, are easy to understand, and work on mobile just as well as on a desktop. Not quite: users want to achieve specific tasks as quickly and easily as possible. Certainly "work quickly" and "work on mobile" are two huge pillars of that for many (probably the majority of) tasks, but for many applications you have to make significant trade-offs in functionality under the constraints of a…
Of course, this is all in context of a typical webpage. There are exceptions to this.
Re: CSS is powerful, you can do a lot of things without JS
#219Earlier quoted context omitted.
"best viewed in Chrome" is getting annoyingly common.
Bank Of America recently told me it only supported Safari and Chrome on MacOS... But... supported Firefox on Windows. Whaaaa....
"We recommend Internet Explorer."
Re: CSS is powerful, you can do a lot of things without JS
#220Earlier quoted context omitted.
Hmmm... .accordion .content { padding:0 10px; overflow:hidden; border:1px solid #fff; -webkit-transition: all .5s ease-out; -moz-transition: all .5s ease-out; } -webkit-transition, -moz-transition... it's like we're at 180 degrees to where the web was in the days of IE4-6
Remember when Good Developers would hate on framesets because they break the back button and linking and everything? Now it's totally OK to break all that with AJAX and "text-as-apps"... I much prefer the days of the old web.
https://developer.mozilla.org/en-US/docs/Web/API/History_API...