1

As the title would suggest, I'm trying to shift the position of the image container vertically upwards (this is in order to give more room for my captions on mobile displays).

It seems that the image container div (class="pswp__img") sits within another div with class="pswp__zoom-wrap". This second div determines the position of the image via the CSS style "transform: translate3d(..)". I have tried parsing through the photoswipe.js script, however my somewhat limited knowledge of JS has me stuck.

Can anyone point me to where in the photoswipe.js script the vertical offset in "transform: translate3d(..)" is set?

Link to github repo containing JS files of interest (photoswipe.js & photoswipe-ui-default.js are the two files to look at): https://github.com/dimsemenov/PhotoSwipe/tree/master/dist

Below are chunks from "photoswipe.js" which are involved with setting translate3d that I've found so far:

_applyZoomTransform = function(styleObj,x,y,zoom) {
    styleObj[_transformKey] = _translatePrefix + x + 'px, ' + y + 'px' + _translateSufix + ' scale(' + zoom + ')';

_translatePrefix = 'translate' + (allow3dTransform ? '3d(' : '(');
_translateSufix = _features.perspective ? ', 0px)' : ')';
Lior
  • 21
  • 3

0 Answers0