Just in case your not familiar with Lightbox JS: It’s a neat little piece of JavaScript who helps web designers presenting images in a visual pleasing way. Instead of just displaying the image in the existing or a new browser window, the image will be placed on top of the website, while the latter one is faded out. The script is unobtrusive, which means images can still be displayed the normal way in case JavaScript is turned off. There are two versions available, Lightbox JS and LightBox JS v2.0 – you should check them out.
This posting is about the two versions, or let’s say the difference between them. With version 2, there’s also a new option to group images into a set. If you then open an image, thumbnails of the other ones are displayed below it, so you can navigate through them. Works much like the Windows Image Preview function …
… and that’s it. Oh wait, almost forgot – for this new function, the size of the neat “little” JavaScript increased from a discreet 15.6 kilobyte to a whopping 110 kilobyte! That’s right, no typo, more than seven times more than the first version. Just for this little effect. Okay, it now uses the prototype framework, which means it can share the code in case there are other functions relying on it. Taking this into account, the pure code for Lightbox JS v2.0 comes in at about 35 kilobyte – still too much, if you ask me. I mean, those 35 Kilobyte (at least) have to be loaded on every page, and considering that it just provides a nicer solution for viewing images, it is too much.
Don’t get me wrong, I like Lightbox JS, but v2.0 is definetely overweighted. Have you thought of all the modem users out there? Yes, they still exist! And they have to wait at least 9 seconds longer, just for this effect. If I had to choose, I would stick to the first version. Another win for David.
inspired after reading this posting over at wildbits, a german blog.
Not only modem users will be tortured by the weight of the script. Users of mobile browsers (like the PSP) don´t see any Lightbox, but the complet script will be loaded.