WordPress Slimbox Plugin
Slimbox - The Lightbox Clone
If you’re like me, you’re impressed with the effects of Lightbox 2.0. Click on the image thumbnail to see the effect. Lightbox 2.0 uses the Scriptaculous JavaScript library to achieve its effects. To use it, one would simply import the necessary JavaScript files and then add rel="lightbox" to any link to an image.
A downside to using Lightbox (and the Scriptaculous library) is that the included JavaScript files are somewhat large: about 80KB in total. For broadband users, this isn’t a problem, but in terms of search engine optimization and website optimization, large JavaScript libraries can greatly add to a site’s load time, making it harder for search engine bots to crawl and index those sites.
Enter Slimbox. Slimbox is a slimmer clone of Lightbox 2.0, which works in exactly the same way, only the code is much smaller. Instead of using the Scriptaculous library, Slimbox uses the lighter mootools framework. Altogether, Slimbox and the required mootools libraries come to a total of 17KB. Now that’s a bit more reasonable.
WordPress Plugin
I wrapped up Slimbox in a WordPress plugin for my own personal use, but since other WordPress users may want this too, I decided to go ahead and release this as an official plugin. To be honest, all I did was take Safirul Alredha’s WordPress Lightbox Plugin and replaced the Lightbox files with Slimbox. So all the credit (and thanks) should go to the following people:
- Christophe Beyls, for making Slimbox.
- Safirul Alredha, for making the Lightbox plugin.
- Lokesh Dhakar, for making Lightbox 2.0.
Download
To install, simply move the unzipped wp-slimbox folder into your WordPress’s plugins directory and then activate it within the admin panel.
WordPress Slimbox Plugin v1.0 - Released Dec. 14th, 2006.
Initial version. Compressed with base62 encoding. The JavaScript file is only about 16KB in size.
Wordpress Slimbox Plugin v1.41 - Released Aug. 4th, 2007.
Since my first version of this plugin, the Slimbox author has updated Slimbox to use the latest version of Mootools (version 1.11). Unfortunately, this increases the plugin’s size to about 40KB, but it’s still fairly small. Only the necessary Mootools components were included in this download, and I’ve also compressed the JavaScript file using Dojo ShrinkSafe. I’ve opted not to use a base62-based compression this time because it’s been known to cause issues with certain scripts.
Comments
Nice work!
I couldn’t believe it when I realised the Wordpress/Lightbox 2.0 plugin was pushing 100kb, so I’ve gone for v1.0 for the smallest possible size… I’m sure any 56k modem users will be thanking you :)
said 3stripe on August 6th, 2007 @ 4:44 amFinally a slimbox wordpress plugin that works out of the box!
said Chase on December 9th, 2007 @ 12:13 amHi,
said Gijs on January 19th, 2008 @ 8:47 amI do not have much knowledge of scripting, but isn’t this script supposed to create thumbnails? This is what I’ve done ( image #1 ) Can you help me please.
Sorry, this script doesn’t create thumbnails; it only creates the “light box” effect of an image popping out on the screen. I’m sure there’s a WordPress thumbnail plugin out there somewhere that you could use, though.
said Zarjay on January 21st, 2008 @ 2:49 pmExcellent work! I Just wanted to replace lightbox by slimbox script when I found your plugin… So it took me just 2 clicks :)
I my eyes the biggest advantage is that the effect is ready the moment the DOM is parsed… By using the original lightbox script you always have to wait until all images on the page have been loaded otherwise you get linked directly to the clicked image!
Thank you for sharing this plugin!
said Nico on February 29th, 2008 @ 3:44 am