在 Photoswipe Gallery 中增加缩放比例

Increase zoom in Photoswipe Gallery

我在我的站点中使用 photoswipe 图库,我将图像关联到图库,现在我想增加默认缩放,但找不到解决方案,有人可以帮助我吗?谢谢。

我建议您使用更高分辨率的照片,而不是增加变焦。但是,如果您仍然需要增加默认缩放比例。

在您的 options 对象中定义这两个参数。根据需要编辑下面的数字 4

var options = {
    // ...
    // Your other options,
    // ...
    getDoubleTapZoom: function(isMouseClick, item) {
        if(isMouseClick) {
            return 4; //<---- This 4
        } else {
            return item.initialZoomLevel < 0.7 ? 4 : 1.33; //<---- 4 here
        }
    },
    maxSpreadZoom: 4 //<---- and this 4 here
};