[SOLVED][Drupal Colorbox] How to load Javascript within Colorbox?

| | 1 min read

Many Drupal users have requested to know how to load Javascript within Colorbox. If you are looking for a way to load a JS app in Colorbox in your Drupal site then read on to find out the solution.

Here is how to do it.

  • First you need to place the content as as follows
    <div style="display: none;">
    <div id="id-of-content">What ever content you want to display in a Colorbox.</div>
  • Next you need to have the link like this.
    <a class="colorbox-inline" href="?width=500&height=500&inline=true#id-of-content">Link to click</a>

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.