README.txt 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. Drupal colorbox module:
  2. ------------------------
  3. Maintainers:
  4. Fredrik Jonsson (http://drupal.org/user/5546)
  5. Requires - Drupal 7
  6. License - GPL (see LICENSE)
  7. Overview:
  8. --------
  9. Colorbox is a light-weight, customizable lightbox plugin for jQuery 1.4.3+.
  10. This module allows for integration of Colorbox into Drupal.
  11. The jQuery library is a part of Drupal since version 5+.
  12. Images, iframed or inline content etc. can be displayed in a
  13. overlay above the current page.
  14. * jQuery - http://jquery.com/
  15. * Colorbox - http://www.jacklmoore.com/colorbox/
  16. Features:
  17. ---------
  18. The Colorbox module:
  19. * Excellent integration with Image field and Image styles
  20. * Choose between a default style and 5 example styles that are included.
  21. * Style the Colorbox with a custom colorbox.css file in your theme.
  22. * Drush command to download and install the Colorbox plugin in
  23. sites/all/libraries
  24. The Colorbox plugin:
  25. * Supports photos, grouping, slideshow, ajax, inline, and iframed content.
  26. * Appearance is controlled through CSS so it can be restyled.
  27. * Preloads upcoming images in a photo group.
  28. * Completely unobtrusive, options are set in the JS and require no
  29. changes to existing HTML.
  30. * Compatible with: jQuery 1.3.2+ in Firefox, Safari, Chrome, Opera,
  31. Internet Explorer 7+.
  32. * Released under the MIT License.
  33. Installation:
  34. ------------
  35. 1. Download and unpack the Libraries module directory in your modules folder
  36. (this will usually be "sites/all/modules/").
  37. Link: http://drupal.org/project/libraries
  38. 2. Download and unpack the Colorbox module directory in your modules folder
  39. (this will usually be "sites/all/modules/").
  40. 3. Download and unpack the Colorbox plugin in "sites/all/libraries".
  41. Make sure the path to the plugin file becomes:
  42. "sites/all/libraries/colorbox/jquery.colorbox-min.js"
  43. Link: https://github.com/jackmoore/colorbox/archive/1.x.zip
  44. Drush users can use the command "drush colorbox-plugin".
  45. 4. Go to "Administer" -> "Modules" and enable the Colorbox module.
  46. Configuration:
  47. -------------
  48. Go to "Configuration" -> "Media" -> "Colorbox" to find
  49. all the configuration options.
  50. Use the Views Colorbox Trigger field:
  51. ------------------------------------
  52. TODO
  53. Add a custom Colorbox style to your theme:
  54. ----------------------------------------
  55. The easiest way is to start with either the default style or one of the
  56. example styles included in the Colorbox JS library download. Simply copy the entire
  57. style folder to your theme and rename it to something logical like "mycolorbox".
  58. Inside that folder are both a .css and .js file, rename both of those as well to match
  59. your folder name: i.e. "colorbox_mycolorbox.css" and "colorbox_mycolorbox.js"
  60. Add entries in your theme's .info file for the Colorbox CSS/JS files:
  61. stylesheets[all][] = mycolorbox/colorbox_mycolorbox.css
  62. scripts[] = mycolorbox/colorbox_mycolorbox.js
  63. Go to "Configuration" -> "Media" -> "Colorbox" and select "None" under
  64. "Styles and Options". This will leave the styling of Colorbox up to your theme.
  65. Make any CSS adjustments to your "colorbox_mycolorbox.css" file.
  66. Load images from custom links in a Colorbox:
  67. --------------------------------------------
  68. Add the class "colorbox" to the link and point its href attribute to the image
  69. you want to display in the Colorbox.
  70. Load content in a Colorbox:
  71. ---------------------------
  72. Check the "Enable Colorbox load" option in Colorbox settings.
  73. This enables custom links that can open content in a Colorbox.
  74. Add the class "colorbox-load" to the link and build the url like
  75. this "[path]?width=500&height=500&iframe=true"
  76. or "[path]?width=500&height=500" if you don't want an iframe.
  77. Other modules may activate this for easy Colorbox integration.
  78. Load inline content in a Colorbox:
  79. ----------------------------------
  80. Check the "Enable Colorbox inline" option in Colorbox settings.
  81. This enables custom links that can open inline content in a Colorbox.
  82. Inline in this context means some part/tag of the current page, e.g. a div.
  83. Replace "id-of-content" with the id of the tag you want to open.
  84. Add the class "colorbox-inline" to the link and build the url like
  85. this "?width=500&height=500&inline=true#id-of-content".
  86. It could e.g. look like this.
  87. <a class="colorbox-inline" href="?width=500&height=500&inline=true#id-of-content">Link to click</a>
  88. <div style="display: none;">
  89. <div id="id-of-content">What ever content you want to display in a Colorbox.</div>
  90. </div>
  91. Other modules may activate this for easy Colorbox integration.
  92. Drush:
  93. ------
  94. A Drush command is provides for easy installation of the Colorbox
  95. plugin itself.
  96. % drush colorbox-plugin
  97. The command will download the plugin and unpack it in "sites/all/libraries".
  98. It is possible to add another path as an option to the command, but not
  99. recommended unless you know what you are doing.
  100. Image in Colorbox not displayed in Internet Explorer 8:
  101. -------------------------------------------------------
  102. If your theme has CSS like this (popular in responsive design):
  103. img {
  104. max-width: 100%;
  105. }
  106. Internet Explorer 8 will have problems with showing images in the Colorbox.
  107. The fix is to add this to the theme CSS:
  108. #cboxLoadedContent img {
  109. max-width: none;
  110. }