I've been tweeting this today but I think it could be useful to repeat it here: my CSS demos are only experiments. The goal is to test all those new possibilities, show the power of CSS3 and, basically, having fun. They aren't intended to be used in production and actually you shouldn't. Most of them are not accessible and not cross browser…
The author has been doing some really innovative stuff with CSS3 and declarative styles/animations for awhile now so I don't see the problem with these experiments. They're fun, they teach new things, and they're given away for free. Where's the harm?
So I will get lightboxed even with my no-javascript browsing habits? I liked that most sites simply serve the direct image url to me. Lightbox is an annoying eye-candy.
A lightbox is really just an implementation of a 'modal dialog / window' - which is useful, because it demands the user's attention before it can be dismissed.
Being able to produce such a window in web applications could be useful in many situations - we don't need to limit them to image display.
The fact that 'lightboxes' have been abused / over-used, isn't a reason to dismiss the technology.
I don't mind it if it's snappy and the image loads almost instantaneously, which is what I got when viewing this demo. Typically, with javascript, I'd have to wait a few seconds for the loading-wheel to spin until the image finally loads. Not that I can't wait a few seconds; it's just annoying.
You turn javascript off to get rid of lightboxes? I can kind of understand that, but you're also turning off lots of functionality in modern websites/apps. It's like blowing your leg off because your little toe annoys you.
A lightbox is actually just a modal window which elegantly responds to user interaction: the user wanting to view a larger version of the image. I actually think it's way more elegant and userfriendly than a hardlink to the image which distracts you way more from your browser experience than a lightbox.
You're really not the least annoyed by having to ping-pong back and forth when watching an image gallery, with whatever eventual content reloading that may be implied?
Dont like how when i press the back button i get a history of pictures i have viewed. If i am at liberty to choose whichever picture i want then i dont need the back button to preserve my selection history. When i click back, i want to go BACK to the site i just came from.
I assume this isnt some bug or some flaw, and that it can probably be coded to behave differently, but as things stand that would prevent me from using this particular lightbox.
Interesting to see this is possible, but this is beyond what I would want to use css for, how far will "look ma! no javascript!" go? Seing the logic in a jquery click handler seems at least as readable / maintainable as a bunch of css rules for the same reason I prefer to have more logic in java in android applications than in various xml layout and manifest files.
It's easier to optimize a description of what the results should be than to optimize a description of how to calculate the results. If you say "give me the first 10 prime numbers", that's easy to calculate efficiently . If you write out the Sieve of Eratosthenes, then that's harder to make efficient.
Similarly, it's easier to optimize CSS rendering than it is to optimize arbitrary JavaScript programs.
- respect my back button [1]
- allow me to click outside the picture or press esc to close the lightbox
- allow middle-click to open the image directly
[1] We can argue about transitions and correct behavior all day, but this implementation is different from other lightboxes I've seen, and thus it is "broken" to me.
Out of curiosity, what is the point of a "light box"? I tend to open lots of images into new tabs while I'm reading articles, and it's really annoying to have the rest of the article go black when I do.
Unfortunately, lightbox-style galleries still behave inconsistently across hardware/platforms/browsers and often break. And, you're right, many people find them annoying. But as a developer who recently converted a portfolio site, I can tell you that it tremendously simplifies the code needed to present a gallery of images, making a portfolio-oriented site much more easy to update. Also, clients tend to go ga-ga over the slick eye candy (thus decreasing the demand for Flash, so it's not all bad).
Very neat, I checked out the other stuff you've got on there and it's pretty sweet.
Seems like a lot of people have missed the point that this is just a hack to see if a light box in JUST CSS and HTML could be made. Because theres no JS or actual logic, this demo just leverages the browser to maintain the state. It's a necessary side effect that the back buttons behave this way, and it could be coded to behave differently, but that would defeat the purpose of the exercise.
It's done by using the :target selector. Targeted images are lightboxed. There is a link in the lightbox that resets the target to dismiss the lightbox. Crudely:
This is actually quite nice because it allows permalinks to the lightbox items. This makes for a rough browsing experience if you need to go back, but I like the detail that lets you link somewhere that someone can actually find in the future vs. "go to this page, then click here, etc...."
[+] [-] deaxon|15 years ago|reply
[+] [-] flyosity|15 years ago|reply
[+] [-] p0larboy|15 years ago|reply
[+] [-] aw3c2|15 years ago|reply
[+] [-] lwhi|15 years ago|reply
Being able to produce such a window in web applications could be useful in many situations - we don't need to limit them to image display.
The fact that 'lightboxes' have been abused / over-used, isn't a reason to dismiss the technology.
[+] [-] kyro|15 years ago|reply
[+] [-] lukevdp|15 years ago|reply
[+] [-] risratorn|15 years ago|reply
[+] [-] hackermom|15 years ago|reply
[+] [-] krmmalik|15 years ago|reply
I assume this isnt some bug or some flaw, and that it can probably be coded to behave differently, but as things stand that would prevent me from using this particular lightbox.
[+] [-] seldo|15 years ago|reply
http://playground.deaxon.com/css/lightbox/#pic3
That's a permalink to an individual lightboxed photo. No JS, no server-side magic. Colour me very impressed.
[+] [-] ndunn2|15 years ago|reply
[+] [-] jluxenberg|15 years ago|reply
[+] [-] DTrejo|15 years ago|reply
- my grandma, who has a scroll wheel in the middle of her mouse
[+] [-] brlewis|15 years ago|reply
[+] [-] pedrokost|15 years ago|reply
[+] [-] unknown|15 years ago|reply
[deleted]
[+] [-] cmer|15 years ago|reply
[+] [-] nickbarnwell|15 years ago|reply
[+] [-] aditya42|15 years ago|reply
[We can argue the pureness of the demo after that till the end of time though.]
[+] [-] catch23|15 years ago|reply
[+] [-] Semiapies|15 years ago|reply
[+] [-] bradlane|15 years ago|reply
Of course, it's horribly, horribly broken in IE. Then again, that goes without saying ;)
[+] [-] 425|15 years ago|reply
[+] [-] krosaen|15 years ago|reply
[+] [-] jrockway|15 years ago|reply
Similarly, it's easier to optimize CSS rendering than it is to optimize arbitrary JavaScript programs.
[+] [-] nowarninglabel|15 years ago|reply
[+] [-] IChrisI|15 years ago|reply
[+] [-] Yaggo|15 years ago|reply
Word. I always make my lightboxes to close on ESC. I hate when I'm forced to click some tiny random-located icon.
[+] [-] blhack|15 years ago|reply
[+] [-] qjz|15 years ago|reply
[+] [-] hasenj|15 years ago|reply
I suspect it's a classical case of "you're not your user".
I personally think it's really annoying for the technically literate, and really confusing for the rest of the population.
What I really love, is the chrome plugin that zooms facebook photos on hovering them; facebook photo zoom[1]
[1]: https://chrome.google.com/extensions/detail/elioihkkcdgakfba...
[+] [-] lwhi|15 years ago|reply
[+] [-] torme|15 years ago|reply
Seems like a lot of people have missed the point that this is just a hack to see if a light box in JUST CSS and HTML could be made. Because theres no JS or actual logic, this demo just leverages the browser to maintain the state. It's a necessary side effect that the back buttons behave this way, and it could be coded to behave differently, but that would defeat the purpose of the exercise.
[+] [-] TamDenholm|15 years ago|reply
[+] [-] dpatru|15 years ago|reply
css: a.lb:target {display:block; text-align:center;} a.lb {display:none;}
html: <a href="#img">show image</a> <a class="lb" href="#" id="img"><img src="image.jpg"></a>
[+] [-] unknown|15 years ago|reply
[deleted]
[+] [-] EGF|15 years ago|reply
[+] [-] dmix|15 years ago|reply
Also, is there any documentation/github repos?
[+] [-] aditya42|15 years ago|reply
https://developer.mozilla.org/En/CSS/:target
[+] [-] nym|15 years ago|reply
- Works without transactions in Firefox
- Does not work in Internet Explorer 6, 7, or 8.
[+] [-] ryanc|15 years ago|reply
[+] [-] unknown|15 years ago|reply
[deleted]
[+] [-] unicornhorn|15 years ago|reply
[+] [-] bradlane|15 years ago|reply
http://playground.deaxon.com/css/
[+] [-] lurchpop|15 years ago|reply
- 2nd UL list is opacity:0 - :target psuedoclass applies to element whose id is in the url - targeted element has opacity:1
[+] [-] DjDarkman|15 years ago|reply