Activation

Check to activate Colorbox for current blog. When inserting an image into a post, do not forget to choose "as a link to original image" option

Theme

Choose Colorbox theme. You may then personalize your theme by following instructions for personal files in advanced configuration.

Zoom icon

Colorbox can display a zoom icon on thumbnails. Choose its position, right or left, it will be displayed over the thumbnail when hovering it with the mouse. The icon may also be displayed permanently.

Personnal files

Included themes

Colorbox ships with 6 themes to choose its modal window's appearance. You may modify any of them by adding your personnal stylesheet and images.

Lightbox Classic theme is special : it is designed to look exactly like the former Lightbox plugin by Olivier Meunier, and has no view counter and no slideshow commands.

Modifying themes

Principle

Colorbox modal window can be entirely styled using CSS, and its navigation images modified.

Colorbox allows to define for each theme a personnal stylesheet, stored in your public or your theme folder, and whose rules will overwrite existing theme rules.

Here is how to do it:

Create a personnal Colorbox theme directory

You can store your pesonnal files in:

At the root of the chosen location, first create the necessary sub-directories to get the following hierarchy :

colorbox/themes/x/

where x is the number of the theme you wish to modify. In this directory you will store all your modifications on the theme. Repeat this operation and change each time x for the corresponding number if you wish to modify several themes.

Create your stylesheet

Add now in directory x a stylesheet named colorbox_user.css with only the rules you want to apply instead of theme rules, i.e.

#cboxOverlay{background-color:red;}

if you only wish to change modal window background color.

Add images

If you wish to modify modal window navigation graphics, place your images in the personnal directory, and refer to them in colorbox_user.css.

Selectors

By default, Colorbox is activated only for images within posts.

If you wish to activate it for supplementary blocks, type here the list of selectors, comma separated, corresponding to these blocks.

For example if you wish to activate Colorbox for blocks #sidebar and #pictures, type:

#sidebar,#pictures

in the field. Please note that images contained in the blocks will be considered as being in separate groups for images counters and slideshows.

If you leave this field empty, only post images will be displayed by Colorbox.

Effects

Option Default Description
Transition type "elastic" The transition type. Can be set to "elastic", "fade", or "none".
Transition speed 350 Sets the speed of the fade and elastic transitions, in milliseconds.
Opacity 0.85 The overlay opacity level. Range: 0 to 1.
Auto open Colorbox false If true, the lightbox will automatically open with no input from the visitor.
Enable preloading for photo group true Allows for preloading of 'Next' and 'Previous' content in a shared relation group (same values for the 'rel' attribute), after the current content has finished loading. Set to 'false' to disable.
Enable close by clicking on overlay true If true, enables closing Colorbox by clicking on the background overlay.
Enable slideshow false If true, adds an automatic slideshow to a content group of images.
Auto start slideshow true If true, the slideshow will automatically start to play.
Slideshow speed 2500 Sets the speed of the slideshow, in milliseconds.
Slideshow start display text "start slideshow" Text for the slideshow start button.
Slideshow stop display text "stop slideshow" Text for the slideshow stop button

Modal window

Key Default Description
Images legends Image alt attribute Allows to choose legend that will be displayed : image alternative text, link title or none.
Default title false This can be used as an anchor title alternative for Colorbox.
Current text "{current} of {total}" Text format for the content group / gallery count. {current} and {total} are detected and replaced with actual numbers while Colorbox runs.
Previous text "previous" Text for the previous button in a shared relation group (same values for 'rel' attribute).
Next text "next" Text for the next button in a shared relation group (same values for 'rel' attribute).
Close text "close" Text for the close button. The 'Esc' key will also close Colorbox.
Loop on slideshow images true If 'true' Colorbox will loop on images (clicking on last image takes you to the first).
Display content in an iframe false If 'true' specifies that content should be displayed in an iFrame.

Dimensions

Key Default Description
Fixed width false Set a fixed total width. This includes borders and buttons. Example: "100%", "500px", or 500
Fixed height false Set a fixed total height. This includes borders and buttons. Example: "100%", "500px", or 500
Fixed inner width false This is an alternative to 'width' used to set a fixed inner width. This excludes borders and buttons. Example: "50%", "500px", or 500
Fixed inner height false This is an alternative to 'height' used to set a fixed inner height. This excludes borders and buttons. Example: "50%", "500px", or 500
Scale photos true If 'true' and if maxWidth, maxHeight, innerWidth, innerHeight, width, or height have been defined, Colorbox will scale photos to fit within the those values.
Show overflowing content false If 'false' Colorbox will show scrollbars for overflowing content. This could be used on conjunction with the resize method (see below) for a smoother transition if you are appending content to an already open instance of Colorbox.
Initial width 300 Set the initial width, prior to any content being loaded.
Initial height 100 Set the initial height, prior to any content being loaded.
Max width false Set a maximum width for loaded content. Example: "100%", 500, "500px"
Max height false Set a maximum height for loaded content. Example: "100%", 500, "500px"

Javascript

Option Defaut Description
Callback name for onOpen event false Callback that fires right before Colorbox begins to open.
Callback name for onLoad event false Callback that fires right before attempting to load the target content.
Callback name for onComplete event false Callback that fires right after loaded content is displayed.
Callback name for onCleanup event false Callback that fires at the start of the close process.
Callback name for onClosed event false Callback that fires once Colorbox is closed.

Goodie

Colorbox display more than images, here are some instructions to start playing with:

html content

Create a file named test.html containing the html code you want Colorbox to display, for example

<p>Test</p>
      <p><img src="/public/test.jpg" alt="" /></p>

Send this file and the image to your public folder.

Type this (wiki syntax) in your post:

///html
      <script type="text/javascript">
      $(document).ready(function(){
      $(".html").colorbox();
      });
      </script>
      
      <p><a class="html" href="/public/test.html" title="My pretty html">html</a></p>
      ///

When you click on the link, test.html is displayed by Colorbox.

Other content

On the same idea, if test.html contains a video player code within its object tags, the video will be dispalyed in Colorbox.

Possibilities offered by this system are numerous and interesting...