Fancybox 2 - Stop resizing in the gallery

I am trying to get Fancybox to stop resizing images in the gallery. I have larger images that need scrolling. Here is my current fancybox jQuery:

$('.gallery').fancybox({ padding: 0, scrolling: 'yes', openEffect : 'elastic', openSpeed : 150, prevEffect : 'fade', nextEffect : 'none', closeEffect : 'elastic', closeSpeed : 100, closeBtn : false, arrows : true, nextClick : true, helpers : { thumbs : { width : 50, height : 50 }, overlay : { opacity : 0.8 } } }); 
+4
source share
2 answers

Set fitToView to false like this:

 $('.gallery').fancybox({ fitToView: false, // add this padding: 0, scrolling: 'yes', openEffect : 'elastic', openSpeed : 150, prevEffect : 'fade', nextEffect : 'none', closeEffect : 'elastic', closeSpeed : 100, closeBtn : false, arrows : true, nextClick : true, helpers : { thumbs : { width : 50, height : 50 }, overlay : { opacity : 0.8 } } }); 
+4
source

The autoScale property works for me.

 $('.gallery').fancybox({ 'autoScale':false, }); 
0
source

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


All Articles