How do I display, in a ColorBox popup, a caption AND a title (caption from image 'alt' attribute and title from 'title' attribute I am trying to display in a ColorBox popup, a caption AND a title (caption from image 'alt' attribute and title from image 'title' attribute).
The colorbox is opened when an image is clicked. 

Here is an example of what I want to do.


  


The img will be something like the following.

&lt;img typeof="foaf:Image" src="http://localhost:4444/img.jpg" width="336"   height="254" alt="LEGEND / CAPTION balbalblalblalba balbalblalblalba balbalblalblalba" title="TITLE balbalblalblalba balbalblalblalba balbalblalblalba" class=""&gt;


Do you have any idea of how can I do that?

I am using: 


Colorbox 7.x-2.10
Drupal 7.35


The colorbox module settings are the following.
Add "colorbox" class to your element. You could also select by document.getElementsByTagName("img"), but we don't really want to select every single img tag.

var cbox = document.getElementsByClassName("colorbox")

for (var i=0, i &lt; cbox.length; i++) {
  cboxTitle = cbox[i].title;
  cboxAlt= cbox[i].alt;

  cboxTitle = "&lt;span class='title'&gt;" + cboxTitle + "&lt;/span&gt; &lt;span class='alt'&gt;" + cboxAlt + "&lt;/span&gt;"
}


You then just got to make colorbox print out the title tag and style it the way you want.