Photoswipe: Multiple zoom level

Created on 1 Sep 2017  路  2Comments  路  Source: dimsemenov/PhotoSwipe

Hi !
Great plugin that works surprisingly well cross-device !
Thanks a lot for giving such great work for free !

Is it possible to have multiple zoom level on an image ?
Likes so : Thumbnail > Small > Medium > Big
So once a click is performed on a thumbnail it opens the Small images and further clicks on
the opened image (or zoom button) will load the Medium, then the Big and then return to the small ?

Thanks in advance !

Most helpful comment

I have done this by:

        getDoubleTapZoom: function(isMouseClick, item) {

            if(!item.zoomLevel) {
                item.zoomLevel = item.initialZoomLevel
            }

            var res;

            if(item.zoomLevel < 0.5) {
                res = 0.5
            } else if(item.zoomLevel < 1) {
                res = 1
            } else if(item.zoomLevel < 1.5) {
                res = 1.5
            } else if(item.zoomLevel < 2) {
                res = 2
            } else if(item.zoomLevel < 2.5) {
                res = 2.5
            } else {
                res = item.initialZoomLevel
            }

            item.zoomLevel = res;
            return res;
        }

All 2 comments

I have done this by:

        getDoubleTapZoom: function(isMouseClick, item) {

            if(!item.zoomLevel) {
                item.zoomLevel = item.initialZoomLevel
            }

            var res;

            if(item.zoomLevel < 0.5) {
                res = 0.5
            } else if(item.zoomLevel < 1) {
                res = 1
            } else if(item.zoomLevel < 1.5) {
                res = 1.5
            } else if(item.zoomLevel < 2) {
                res = 2
            } else if(item.zoomLevel < 2.5) {
                res = 2.5
            } else {
                res = item.initialZoomLevel
            }

            item.zoomLevel = res;
            return res;
        }

This is very helpful, however it's only working on the first two images for me.

Was this page helpful?
0 / 5 - 0 ratings