fancyBox 2:格式化标题
问题描述:
对于fancyBox 1.x,有一个有关如何设置标题格式的信息.我在新版本中缺少此功能...
For fancyBox 1.x there was an info how to format a title. I'm missing this for the new version...
我想添加一个标题,例如"x的图像1.您可以在[= link]中找到孔画廊"
I want to add a title like "Image 1 of x. You can find the hole gallery here [=link]"
答
对于fancybox v2.0.x,您可以使用beforeShow
选项自定义/格式化title
,例如:
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