Javascript 如何在FeatherLight图像库中添加描述文本?

Javascript 如何在FeatherLight图像库中添加描述文本?,javascript,featherlight.js,Javascript,Featherlight.js,正在尝试了解如何将文本说明添加到featherlight.js lightbox图像库。有人知道或有经验吗 下面是一个html布局的示例: <div class="mix digital" data-myorder="12" style="display: inline-block;"> <a class="gallery2" href="gallery_images/design/woodcut.jpg"> <div class="

正在尝试了解如何将文本说明添加到featherlight.js lightbox图像库。有人知道或有经验吗

下面是一个html布局的示例:

<div class="mix digital" data-myorder="12" style="display: inline-block;">
        <a class="gallery2" href="gallery_images/design/woodcut.jpg">
        <div class="thumbnail" style="background-image:url(gallery_images/design/woodcut_th.jpg);"></div></a>
    </div>

<div class="mix digital" data-myorder="11" style="display: inline-block;">
        <a class="gallery2" href="gallery_images/design/script.jpg">
        <div class="thumbnail" style="background-image:url(gallery_images/design/script_th.jpg);"></div></a>
    </div>

…再加上更多的图像

我只想能够添加一点文字,作为打开灯箱时图像的描述,但在文档中找不到


如果没有,有人知道一个好的/轻的灯箱可以实现这一点吗?

featherlight
的目标是轻,没有内置选项,但使用
afterContent
回调很容易

例如,假设您的文本位于
a
标记的
'alt'
属性中,您可以指定:

afterContent: function() {
    // Add a div for the legend if needed:
    this.$legend = this.$legend || $('<div class="legend"/>').insertAfter(this.$content);
    // Set the content:
    this.$legend.text(this.$currentTarget.attr('alt'));
}
afterContent:function(){
//如果需要,为图例添加一个div:
this.$legend=this.$legend | |$('').insertAfter(this.$内容);
//设置内容:
this.$legend.text(this.$currentTarget.attr('alt'));
}
这里有一个.

如果您想添加html,例如链接或其他内容,请使用
this.$legend.html()