如何配置featherlight,以便在用户单击较小版本时不调整图像的大小?如果窗口太大,我想要滚动条。下面是我正在使用的HTML:

<a href="#" data-featherlight="http://i.imgur.com/crDSlzw.jpg">
<img src="http://i.imgur.com/crDSlzw.jpg" width="200px">
</a>

目前,当我单击一个大图像时,它会显示在一个灯箱中,但它太小,我无法读取图像中的文本。
代码笔示例:http://codepen.io/xyzerb/pen/gPWxmE
提前谢谢!

最佳答案

您可以为onResize指定一个回调,在该回调中清除内联css:

var dontResize = function() {
  this.$content.css('width', '').css('height', '');
}

可以内联使用:
<a data-featherlight-on-resize="dontResize" ... >

甚至可以使用默认值来更改它们:
$.Featherlight.prototype.onResize = dontResize;

关于jquery - featherlight.js-在不调整大小的情况下打开大图像,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/34643134/

10-11 14:58