The new version cannot find PhotoSwipe.js
Posted: 17 Nov 2021, 01:59
In the old version, I can modify PhotoSwipe.js myself to meet my needs.
1. Double-click the picture on the phone to zoom in, it will be very large, avoid 100% zoom. I can change it like this:or
2. I want to modify it to click on the picture to zoom, instead of the next page. Is there a setting? I want to change PhotoSwipe.js, but I can't find it.
1. Double-click the picture on the phone to zoom in, it will be very large, avoid 100% zoom. I can change it like this:
Code
isClickableElement: function(el) {
return el.tagName === 'A';
},
getDoubleTapZoom: function(isMouseClick, item) {
if(isMouseClick) {
return 1;
} else {
if(item.initialZoomLevel <= 0.2) {
return 0.4;
}else if(item.initialZoomLevel <= 0.3) {
return 0.5;
}else{
return item.initialZoomLevel < 0.5 ? 0.8 : 1.33;
}
}
},
Code
isClickableElement: function(e) {
return "A" === e.tagName
},
getDoubleTapZoom: function(e, t) {
return e ? 1 : t.initialZoomLevel < .2 ? .4 : t.initialZoomLevel < .3 ? .5 : t.initialZoomLevel < .5 ? .8 : 1.33
},