fancyBox 2: formatting title

六眼飞鱼酱① 提交于 2020-01-06 04:12:44

问题


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]"


回答1:


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



回答2:


did you see the docs page

the option called

title - Overrides title content, accepts any HTML



来源:https://stackoverflow.com/questions/10512967/fancybox-2-formatting-title

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!