1 Drupal colorbox module:
2 ------------------------
4 Fredrik Jonsson (http://drupal.org/user/5546)
6 License - GPL (see LICENSE)
11 Colorbox is a light-weight, customizable lightbox plugin for jQuery 1.4.3+.
12 This module allows for integration of Colorbox into Drupal.
13 The jQuery library is a part of Drupal since version 5+.
15 Images, iframed or inline content etc. can be displayed in a
16 overlay above the current page.
18 * jQuery - http://jquery.com/
19 * Colorbox - http://www.jacklmoore.com/colorbox/
27 * Excellent integration with Image field and Image styles
28 * Choose between a default style and 5 example styles that are included.
29 * Style the Colorbox with a custom colorbox.css file in your theme.
30 * Drush command to download and install the Colorbox plugin in
35 * Supports images, image groups, slideshow, ajax, inline, and
37 * Appearance is controlled through CSS so users can restyle the box.
38 * Preloads background images and can preload upcoming images in a
40 * Generates W3C valid XHTML and adds no JS global variables and
42 * Tested in Firefox 2 & 3, Safari 3 & 4, Opera 9, Chrome,
43 Internet Explorer 6, 7, 8.
44 * Released under the MIT License.
49 1. Download and unpack the Libraries module directory in your modules folder
50 (this will usually be "sites/all/modules/").
51 Link: http://drupal.org/project/libraries
52 2. Download and unpack the Colorbox module directory in your modules folder
53 (this will usually be "sites/all/modules/").
54 3. Download and unpack the Colorbox plugin in "sites/all/libraries".
55 Make sure the path to the plugin file becomes:
56 "sites/all/libraries/colorbox/jquery.colorbox-min.js"
57 Link: https://github.com/jackmoore/colorbox/archive/1.x.zip
58 Drush users can use the command "drush colorbox-plugin".
59 4. Go to "Administer" -> "Modules" and enable the Colorbox module.
64 Go to "Configuration" -> "Media" -> "Colorbox" to find
65 all the configuration options.
68 Use the Views Colorbox Trigger field:
69 ------------------------------------
73 Add a custom Colorbox style to your theme:
74 ----------------------------------------
75 The easiest way is to start with either the default style or one of the
76 example styles included in the Colorbox JS library download. Simply copy the entire
77 style folder to your theme and rename it to something logical like "mycolorbox".
78 Inside that folder are both a .css and .js file, rename both of those as well to match
79 your folder name: i.e. "colorbox_mycolorbox.css" and "colorbox_mycolorbox.js"
81 Add entries in your theme's .info file for the Colorbox CSS/JS files:
83 stylesheets[all][] = mycolorbox/colorbox_mycolorbox.css
84 scripts[] = mycolorbox/colorbox_mycolorbox.js
86 Go to "Configuration" -> "Media" -> "Colorbox" and select "None" under
87 "Styles and Options". This will leave the styling of Colorbox up to your theme.
88 Make any CSS adjustments to your "colorbox_mycolorbox.css" file.
91 Load images from custom links in a Colorbox:
92 --------------------------------------------
94 Add the class "colorbox" to the link and point the src to the image
95 you want to display in the Colorbox.
98 Load content in a Colorbox:
99 ---------------------------
100 Check the "Enable Colorbox load" option in Colorbox settings.
102 This enables custom links that can open content in a Colorbox.
103 Add the class "colorbox-load" to the link and build the url like
104 this "[path]?width=500&height=500&iframe=true"
105 or "[path]?width=500&height=500" if you don't want an iframe.
107 Other modules may activate this for easy Colorbox integration.
110 Load inline content in a Colorbox:
111 ----------------------------------
112 Check the "Enable Colorbox inline" option in Colorbox settings.
114 This enables custom links that can open inline content in a Colorbox.
115 Inline in this context means some part/tag of the current page, e.g. a div.
116 Replace "id-of-content" with the id of the tag you want to open.
118 Add the class "colorbox-inline" to the link and build the url like
119 this "?width=500&height=500&inline=true#id-of-content".
121 It could e.g. look like this.
123 <a class="colorbox-inline" href="?width=500&height=500&inline=true#id-of-content">Link to click</a>
125 <div style="display: none;">
126 <div id="id-of-content">What ever content you want to display in a Colorbox.</div>
129 Other modules may activate this for easy Colorbox integration.
134 A Drush command is provides for easy installation of the Colorbox
137 % drush colorbox-plugin
139 The command will download the plugin and unpack it in "sites/all/libraries".
140 It is possible to add another path as an option to the command, but not
141 recommended unless you know what you are doing.
144 Image in Colorbox not displayed in Internet Explorer 8:
145 -------------------------------------------------------
147 If your theme has CSS like this (popular in responsive design):
153 Internet Explorer 8 will have problems with showing images in the Colorbox.
154 The fix is to add this to the theme CSS:
156 #cboxLoadedContent img {