Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Full image size with Fancybox

How can i get the full image size with Fancybox?

It is always resized to viewport. and for one of my project I don't need that.

I tried different options (fitToView, etc.) but i didn't succeed to get the full image size.

It seems that i'm not the only person with this issue: Using fancybox to view full sized image

Any help would be greatly appreciated!

like image 997
Cédric Neveu Avatar asked May 07 '12 18:05

Cédric Neveu


1 Answers

The question might be duplicated but it may have a different answer. Actually the other question apart of being very old and it was never answered, is about how to customize a functionality not existing in fancybox v1.3.x (dynamically resize an image to its full size once is already opened in fancybox). Such functionality has been introduced with the "buttons" helper in fancybox v2.x

On the other hand, if you just want to display images in their original size (not resized to fit in the view port) then: for fancybox v2.x use the API option 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
});
like image 101
JFK Avatar answered Oct 14 '22 18:10

JFK