For the modal box, there are several good jQuery plugins. You've probably heard of ThickBox which is very good, but I myself prefer ColorBox for several usage and aesthetic reasons.
You can download the jQuery ColorBox plugin from here:
Why ColorBox and not ThickBox?
The ThickBox plugin comes bundled with Wordpress and I was a big ThickBox fan, yet, I also preferred the simplicity of jQuery LightBox (jQuery LightBox only works with images). I was quite impressed when I came across ColorBox, there are a few reasons for this:
• Both ThickBox and ColorBox plugins offer modal windows for more than just images.
• You can call up inline elements, external files, and iFrames as well as basic AJAX calls. No problems at all.
However, ColorBox, compared to ThickBox has a few advantages. For ColorBox, Jack Moore really took some time and effort to come up with five, very slick styles for the modal window, and a nice set of callback and extension functions for the more advanced developer to take advantage of. Second, all image loading for the modal window components (the
__transparent background, close, Next, and Back buttons) is handled
XJ^V^ entirely in the stylesheets, so it's very easy for a designer to custom-
style the modal window. On several occasions, I've had to hand edit the thickbox js file in order to get the images to load properly if they were not relative to the plugins js file the way ThickBox intended or if I needed to add a new image.
Last, ThickBox relies on you hand adding the .thickbox class attribute to elements you want to launch the modal window from. While this approach works great for web developers who have the luxury of handcoding everything up, it's a pain for implementing inside a publishing platform such as WordPress for less technical users. Having to coach (and coax) clients through setting their Administration panel editor to HTML and custom adding class attributes to their markup is just painful. None of that is necessary for ColorBox. It is easily controlled with jQuery selectors, so the theme or plugin developer can take care of selections based on WordPress's HTML output allowing the content editors to simply focus on their content without any HTML understanding.
Was this article helpful?