[SOLVED][Drupal Colorbox] Javascript bug prevents Colorbox from working on the home page

| | 1 min read

A few Drupal users reported that a Javascript bug was preventing Colorbox from working on the home page. If you are facing the same issue with Colorbox on any of your pages in your Drupal site then read on to find out the solution.

Here is the solution

  • The reason for this bug is because you have a jQuery script that is not placed in
    (function ($) {
    
    })(jQuery);
  • To find out which file has the missing container code
    • Uncheck "Bandwidth optimization" for JavaScript files in the performance settings.(If you have it enabled)
    • Then review all the JS files that are loaded on the front page or on the page in question.
    • Use the developer tools in your browser in finding the file.
    • Enclose the guilty file with the container code
    • Renable Bandwidth optimization and clear caches

Hope that helps.

The easiest way to solve a Drupal issue is to hand it to the Drupal experts. We can provide a wide range of Drupal services to help you maintain and manage your Drupal websites. Get in touch with us to know more.