Live data from Hacker News

Full CSS3 Lightbox - Absolutely no JavaScript

playground.deaxon.com

11–20 of 114 posts

Re: Full CSS3 Lightbox - Absolutely no JavaScript

#12
post #6

Neat that you can do that. Not a technique that I'd ever want to use.

Why not?

Minor reasons: less performant than Javascript solutions (the transition is sluggish and jittery in Chrome for me) and the fact that I have to click a little target to shrink it back, whereas most Javascript solutions will let me hit Escape or click elsewhere on the page to shrink it back.

Major reason: Separation of concerns: CSS is for appearance, Javascript is for behavior. They don't work well trying to do the other's job. This is touched on by the shrinking problem I mentioned above - it's easy to watch more events to make the behavior of Javascript functionality more flexible or more user-friendly, but not so much in CSS.

That said, it's a toy demonstration of transitions; it's cool that the bear dances, even if I wouldn't take him on Dancing with the Stars.

Re: Full CSS3 Lightbox - Absolutely no JavaScript

#13

Neat that you can do that. Not a technique that I'd ever want to use.

I think I would like to use it.

I consider lightbox functionality to be related to the layout of the content, and hence logically a part of CSS rather than javascript. In CSS3 world, I like to use javascript for the tasks not related to the layout: such as making ajax queries, manipulating user inputted data, etc.

Is there a case for relying on javascript for functionality such as lightbox?

Re: Full CSS3 Lightbox - Absolutely no JavaScript

#16
post #10
post #6

Earlier quoted context omitted.

Why not?

Because it breaks the paradigm of HTML = Content CSS = Style / Design JS = Interaction Once you start to mix them up you start down a hair path

Lightbox functionality encompasses the JS domain (since user is interacting with the page) as well as CSS domain (since the change that is happening on the page is purely of style/design).

So, the breakup which you have given does not unequivocally argue for the use of JS.

Re: Full CSS3 Lightbox - Absolutely no JavaScript

#17

Neat that you can do that. Not a technique that I'd ever want to use.

I think I would like to use it. I consider lightbox functionality to be related to the layout of the content, and hence logically a part of CSS rather than javascript. In CSS3 world, I like to use javascript for the tasks not related to the layout: such as making ajax queries, manipulating user inputted data, etc. Is there a case for relying on javascript for functionality such as lightbox?

Why would lightbox functionality or any other animation and interaction be part of "layout"?

Re: Full CSS3 Lightbox - Absolutely no JavaScript

#18
post #6

Earlier quoted context omitted.

Why not?

Minor reasons: less performant than Javascript solutions (the transition is sluggish and jittery in Chrome for me) and the fact that I have to click a little target to shrink it back, whereas most Javascript solutions will let me hit Escape or click elsewhere on the page to shrink it back. Major reason: Separation of concerns: CSS is for appearance, Javascript is for behavior. They don't work well trying to do the ot…

I also noted the sluggishness that you point out. Do you know the reason? Is it something that could be corrected by changing some parameter in the CSS?

Re: Full CSS3 Lightbox - Absolutely no JavaScript

#19
post #4

Nice! It breaks the back button however...

Au contraire, the back button behaves exactly as it should. It's not how users would expect it to function, but it does obey the stack.

What you just said makes no sense. If a button doesn't follow what the users expect to happen then the button is broken!
Post reply on HN