[SOLVED][Drupal Colorbox] Colorbox does not respect height and width parameters in URLs

| | 1 min read

A few Drupal users have noticed that Colorbox does not respect height and width parameter in URLs of images they are opened within it. If you are encountering the same issue in your Drupal site then read on to find out the solution.

Here is the solution.

  • The best way to solve this issue is to add the class "colorbox-load" to the a link.
  • <a href="/path_to_image/image.large.jpg?width=800&height=600" title="Title" class="colorbox, colorbox-load" rel="gallery-fragment-images">
      <img class="fragment-image" src="/path_to_image/image.jpg">
    </a>
  • Also remember to enable "Enable Colorbox Load from /admin/config/media/colorbox

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.