Would you suggest dropping lightbox entirely? I can’t seem to find an in page pop-up solution that complies to the web standards. But maybe that’s my problem in the first place: using in page pop-ups. I like them because they are fast and do not require a page reload, and they also give a bit more depth to the website. What would you suggest as an alternative?
In case he’s out for the weekend, his issue is pretty much the same as mine: we’re used to clicking on an image and then seeing the full-sized image. Waiting extra time so a script can darken the screen, build some element to hold the image, adding a close button… Not all lightboxes are the ones who slowly load the box and do funky fade-ins but when I was searching for a house to buy, this was annoyance number one: every real estate company in the area did these slow bloated lightbox effects that made stuff look pretty but made it harder for me to just check out a house.
I dunno that you’ll find some “more standards-compliant” version of a lightbox, they’re all mostly the same and the issue isn’t the standards anyway.
(I don’t mind a lightbox-like effect if there’s a page full of tiny thumbnails and the lightbox script has next and prev buttons/arrows/links/whatever, because I’m willing to take the time to get the script going if I can just be one click away from the next full-sized image.)
I’m not sure what you mean about jQuery being a “fat” bloated pile of crap"?
jQuery, and all other Javascript libraries, exist to make the web site developer need less code to write. It’s slower on the browser. Watch:
When you do
$(“#container”).doSomething
that’s not much code. But your browser is still doing
$(“#container”).doSomething… oh that means var $ = document.getElementById(“container”); then $.doSomething…
You skip writing the long version of Javascript, but the browser is now not only going through the jQuery version, it’s still then going through the regular real Javascript version. There’s better explanation in the comments of Dustin Diaz’ site, where he suggest newbs make a function for their getElementByIds and many point out that it’s making the browser do more work.
On top of that, when using a library, the users are downloading even more (unless they have it cached). A simple lightbox can be a single script, but when part of jQuery it’s, load the library, load the plugin, load the lightbox, load the separate lightbox CSS… so it becomes more “worth it” if you are using the one library to run many many scripts. But then you start wondering when you have too many and they’re bogging the site down. Everyone’s got different internet connection speeds.
The reason to use a Javascript library are
-you’re using a lot of plugins other people wrote and that’s easier for you
-you don’t know Javascript, or don’t know it well enough to make it do what all the pre-written stuff in the library does
-you lost your own library (as yeah many people do end up recycling their own shortcut functions everywhere, and yes this is almost always more load on the browser in exchange for less paid developer hours)
It also means I can use some pretty nifty jQuery plugins which save time. But maybe they aren’t worth it?
That’s pretty much the reason to use them, and whether they are worth it is up to you, the developer. Jason can write his own, and doesn’t care to write scripts that do fancy animation, fades, and other junk, so he’ll never find them worth it. Everyone’s different.
If they are making the site worse as far as compliance goes?
No, your markup is just terrible. Actually, jQuery’s resilience is probably why it works on your site. Whether you use a JS library is not really going to be much of a factor in your site’s compliance: any DOM changes Javascript does are not seen or tested by the validator (though if you’re writing your own Javascript, you can make sure the generated HTML code is also still following the rules… I haven’t seen yet any really terrible HTML mistakes in jQuery but I also haven’t looked more than a bit into it).
As far as general reading, a google for “web standards” would probably bring you to various articles about any single particular situation and how to deal with it while adhering to web standards. They take time to learn. WCAG might also be suggested reading, as accessibility is important to web standards but are not related to things like the w3c validator.