Marc
Marc

Reputation: 91

fancyBox 2: formatting title

For fancyBox 1.x there was an info how to format a title. I'm missing this for the new version...

I want to add a title like "Image 1 of x. You can find the hole gallery here [=link]"

Upvotes: 1

Views: 3265

Answers (2)

JFK
JFK

Reputation: 41143

For fancybox v2.0.x you could customize/format the title using the beforeShow option like:

$(".fancybox").fancybox({
   beforeShow : function() {
    this.title = (this.title ? '' + this.title + '' : '') + 'Image ' + (this.index + 1) + ' of ' + this.group.length + '. You can find the whole gallery  <a href="/parth/to/gallery">here</a>';
   }
}); // fancybox

Upvotes: 7

Haim Evgi
Haim Evgi

Reputation: 125486

did you see the docs page

the option called

title - Overrides title content, accepts any HTML

Upvotes: 0

Related Questions