failing like never before

24Jul/080

Lightbox Effects

So unless you've spent the last few years never clicking on an image on a web page, you're quite familiar with Lightbox-like effects (and if not with the name then at least with the effect itself). Here's an example of Lightbox2 for those unfamiliar with it.

When I say "Lightbox-like," I am referring to any kind of "effect" that allows for embedded pop-ups of images and other forms of media (i.e. flash videos, etc). The benefit of Lightbox, aside from the aesthetics, is that it doesn't result in an actual pop-up (which are often blocked by a pop-up blocker on a modern browser), or require the user to navigate to another page and then hit the browser's "back" button to navigate back to the main content. The basic idea is that Lightbox makes a visitor's life easier, supposedly.

I have two problems with Lightbox-like effects. Firstly, the Javascript files required for the effects tend to fatties. The Lightbox2 Javascript files take up 18Kb, but Lightbox2 also requires the Prototype and Scriptaculous libraries which take up 172Kb. Its not a big deal if you're site is already heavily AJAX-ified and already uses Prototype and Scriptaculous, but not everyone's site does. Quite frankly, I find it to be highly annoying that I spend so much time slimming down my images and making sure that people without lightening fast Internet connections can easily access my sites, only to have Lightbox, which is supposed to improve the visitor's experience, bog my site down by requiring 190Kb of Javascript files. There are of course, many alternatives to Lokesh Dhakar's original Lightbox and Lightbox2, many of them which are much lighter in memory. I stumbled across this helpful "Lightbox Clones Matrix" a month or so back, and it usefully lists memory sizes for each "Lightbox clone."

The second problem that I have with Lightbox-like effects, (and is in my opinion a larger issue then the first) is the fact that the fancy scrolling and resizing effects that web developers are so found of (and I must confess, I too am fond of the flashy effects) can be quite processor intensive. I'm running an IBM Thinkpad T21 right now, with 256MB of RAM, an 800MHZ Intel Pentium 3, Arch Linux, Openbox, and Opera, and watching Lightbox2 render is painful to watch. Lightbox2 first has to darken the screen, then put the little white box in the middle of the screen, explode the little box outwards, and fade in the proper image into the box, a process which takes almost four very ugly seconds. On my mom's old Sony Vaio with a 900MHZ AMD CPU, it takes about the same time. For some reason, my desktop, a 3GHZ Intel P4 with 1 gig of RAM, I get even worse performance under Debian Linux (I blame my ATI graphics card, although I have no proof at all). Even many of the supposedly "lighter" Lightbox clones, are just as bad or worse; I had one clone lock my browser up for a good ten seconds, I couldn't even switch tabs. The problem is, is that while most Lightbox-like effects are meant to gracefully work with old browsers that don't support Javascript, the developers never stopped to consider what would happen on a slightly older computer with a relatively new browser with full Javascript support. People still clutching to their trusty old Thinkpad T40s and their shiny iBooks, kinda get it in the pants. While it is impractical and unfair to expect web developers to forsee every possible scenario, (especially when some of them are just high school kids banging away at their dad's work laptop) I still find this issue to be highly disappointing.

I like Lightbox. I like the cool scrolling and resizing effects and how much nicer it makes my sites, and do not mean to belittle the efforts of so many web developers who spent time writing Lightbox and its clones.  Normally, if my website's technology was discriminating against a very small population of Internet surfers, I wouldn't worry to much about it. But selfish bastard that I am, when my website starts to discriminate against me, I am forced to look for alternatives. So now I'm looking for a Lightbox-ish clone that offers all the benefits without any of the aforementioned deficiencies.

As always, feel free to leave me a comment.

Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


Security Code:

Trackbacks are disabled.