fancyBox 2:格式化标题 [英] fancyBox 2: formatting title

查看:130
本文介绍了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

这篇关于fancyBox 2:格式化标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆