Fancybox Full Image Size

How can I get the full size of an image using Fancybox?

It is always changed for the viewport. and for one of my projects I don’t need it.

I tried different options (fitToView, etc.), but I was not able to get the full size of the image.

It seems that I'm not the only person with this problem: Using fancybox to view full size image

Any help would be greatly appreciated!

+6
source share
1 answer

The question may be duplicated, but it may have a different answer. In fact, another question , besides being very old and never answered, is how to configure functionality that does not exist in fancybox v1.3.x (dynamically resizing an image to its full size once already open in fancybox). This functionality was introduced using the " buttons " helper in fancybox v2.x

On the other hand, if you just want to display the images in their original size (without resizing to fit the view port), then: for fancybox v2.x use the fitToView: false API fitToView: false . For fancybox v1.3.x use "autoScale": false

 $(".fancybox").fancybox({ // if fancybox 1.3.x "autoScale": false // if fancybox 2.x fitToView: false // // don't use both }); 
+16
source

Source: https://habr.com/ru/post/915120/


All Articles