fancybox icon indicating copy to clipboard operation
fancybox copied to clipboard

autoResize: false Functionality v3

Open KateMort opened this issue 9 years ago • 7 comments

Hi, coming from Fancybox v2 we used autoResize : false and would need the exact same option for v3 but unfortunately haven't found a working solution.

The images shall not be enlarged. At least not on the desktop. (for mobile we are fine with the standard behavior of enlarging images) Scaling images down if they are larger than the viewport is fine.

We experimented with CSS

.fancybox-image { max-width:50%; max-height:auto; }

But this does not work, since: the image is twice the size (shall be displayed at 50% for retina screens) and width/height is not defined in the image tag.

KateMort avatar Oct 11 '17 22:10 KateMort

Hi,

If you are looking for disabling zoom on click, then use clickContent option, default value is:

clickContent : function( current, event ) {
    return current.type === 'image' ? 'zoom' : false;
}

fancyapps avatar Oct 12 '17 06:10 fancyapps

Hi, it's not about zoom on click. It's about the feature of Fancybox 2: autoResize : false The pictures shall be displayed at their ACTUAL size. But the standard behavior of Fancybox 3 is to enlarge them if the the browser window dimensions are larger.

KateMort avatar Oct 12 '17 06:10 KateMort

Sorry, I do not get you. The whole point of fancyBox is to display larger image. Also, autoResize option was used to enable/disable content resizing after window resize event.

fancyapps avatar Oct 12 '17 06:10 fancyapps

please excuse the confusion. the website has thumbnails and a fancybox group. a click on the thumbnails opens fancybox and shows the picture almost full size in the browser window. it also scales up and down the image when resizing the window. we would like to click the thumbnail and a larger representation of it opens in fancybox BUT fancybox should rather display that image at its actual size (or half the size for retina displays). it shall not scale up when resizing the window or when opening fancybox.

KateMort avatar Oct 12 '17 06:10 KateMort

the settings we are referring to were probably fittoview and pixel ratio in version 2.

KateMort avatar Oct 12 '17 06:10 KateMort

So, you want to disable resizing completely and display image in actual size? Sorry, there is no option for that, yet. There is already a feature-request for that and it is planned to implement that after fixing some issues.

fancyapps avatar Oct 12 '17 06:10 fancyapps

Yes, either disabling resizing completely OR maybe only upscaling (downsizing might be still useful if the window is smaller then the image's actual size). We are really looking forward to this feature!!! Otherwise, version 3 is truly amazing. Good job!!!

KateMort avatar Oct 12 '17 18:10 KateMort