Reputation: 583
I noticed that a lot of users were having the same issue, trying to get a link within one of the title attributes within the lightbox, ColorBox.
What I'm trying to accomplish is to have the title for one of the pictures in the grouped gallery that says something like:
"My website: Click <a href:"http://thompson-mcclellan.com"
target="_blank">Here</a>"
for one of the pictures within my grouped gallery. But nothing shows up whenever I try to code it as you stated in the discussion post above.
Here is my JQuery:
$("a[rel='portfolio'] #tmc").colorbox({title:'Click <a
href="http://thompson-mcclellan.com">Here</a>'});
Here is my HTML:
<a id="tmc" href="images/portfolio/tmc.jpg" rel="portfolio"><img
src="images/portfolio/tmc_thumb.jpg" alt="" /></a>
Here is my example website: http://abrielshipley.com/portfolio/index.html
Upvotes: 1
Views: 1513
Reputation: 196002
First of all, in your example page the id tmc is applied on the a tag and not on something inside it. So our selector is wrong. Just use $('#tmc')
.
As far as the colorbox now, the title should be a function that returns the text to display, not a static string.
So
$("#tmc").colorbox({
title: function() {
return 'Click <a href="http://thompson-mcclellan.com">Here</a>';
}
});
Upvotes: 4