[Drupal] How to create custom colorbox style in Drupal 7

November 29, 2016 - 11:55

You can create your custom colorbox styles instead of using plugin provided styles. For creating custom colorbox style go to /sites/all/modules/contrib/colorbox/styles
copy any one of the folders. (You can find plain, default and stockholmsyndrom styles there).Place the copied folder into your theme folder. Rename the folder with your custom name. Also rename the css and js files.

ie, if your custom colorbox style is "My custom style" then rename folder as my_custom_style. The css and js files are "colorbox_style.css" and "colorbox_style.js" respectively. Change them to "colorbox_my_custom_style.css", "colorbox_my_custom_style.css". Open your themes .info file and append new files.


stylesheets[all][] = my_custom_style/colorbox_my_custom_style.css
scripts[] = my_custom_style/colorbox_my_custom_style.js

Make required changes on css and js files. Now your custom colorbox style is ready, go to admin/config/media/colorbox set style to 'none' in styles and options area.

Hope this helps! Please feel free to get in touch with us for further queries.

Get Drupal updates straight to your inbox

To prevent automated spam submissions leave this field empty.

Post your comments / questions