Featherlight Gallery 中的二进制图像数据

Binary Image data in Featherlight Gallery

featherlight plugin works just fine using the data-featherlight="image" parameter. Using binary image data in a featherlight gallery 中使用二进制图像数据可以正确显示图像,但不要 link 将它们一起添加到图库中。

这里是一个简单的 jsfiddle 使用基本的 featherlight 语法,如下所示:

<a href="data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/XBs/fNwfjZ0frl3/zy7////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABAALAAAAAAQABAAAAVVICSOZGlCQAosJ6mu7fiyZeKqNKToQGDsM8hBADgUXoGAiqhSvp5QAnQKGIgUhwFUYLCVDFCrKUE1lBavAViFIDlTImbKC5Gm2hB0SlBCBMQiB0UjIQA7" data-featherlight="image">
  <img src="data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/XBs/fNwfjZ0frl3/zy7////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABAALAAAAAAQABAAAAVVICSOZGlCQAosJ6mu7fiyZeKqNKToQGDsM8hBADgUXoGAiqhSvp5QAnQKGIgUhwFUYLCVDFCrKUE1lBavAViFIDlTImbKC5Gm2hB0SlBCBMQiB0UjIQA7" />
</a>

我刚刚发现二进制图像数据与未将图像链接到 Featherlight Gallery 的问题没有任何关系。

我动态添加图像,这似乎是在绑定 Featherligth 之后发生的。所以我不得不像那样手动绑定它,一切正常:

$(".gallery").featherlightGallery();