4 ms·
Why not?
by ronaldj 16y ago
Why not?
- atlbeer 16y agoBecause 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
- thevivekpandey 16y agoLightbox 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.
- Semiapies 16y agoIt argues more for JS than CSS.
- Semiapies 16y agoMinor 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.
- thevivekpandey 16y agoI 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?
- Semiapies 16y agoNot entirely sure. The animation speed might be adjustable, but the jitteriness is probably due to browser support (or earliness thereof).