loading
Please wait while loading...
Back Prettify mobile view of pretty photo

I got the issue that pretty photo shows photos too small on mobile device, I think the problem just caused by the calculating of the resizing, so I try to find the snippet of the resize function from the js source and that was easily got the solution as below:

I am using the 3.1.6 version, please find the function _fitToViewport in line 568. Then scroll down some more you will see imageWidth = (windowWidth - 200); and imageHeight = (windowHeight - 200);

Just reduce the number and then the mobile view will become very nice!! I try to adjust many times and got the best fit number is 38 and 100. You can just copy the following code to replace the original one:

if(pp_containerWidth > windowWidth - 38){
    imageWidth = (windowWidth - 38);
    imageHeight = (height/width) * imageWidth;
} else if(pp_containerHeight > windowHeight - 100) {
    imageHeight = (windowHeight - 100);
    imageWidth = (width/height) * imageHeight;
} else {
    fitting = true;
};

 

Comments
comments powered by Disqus