Hello!

Initially images in a gallery of various sizes and orientations

I would like them to automatically turn over to the whole page, either in width or height, depending on the orientation of the image. Now I do this:

$('.fancybox').fancybox({ minHeight: $(window).height(), maxHeight: $(window).height(), fitToView: true }) 

But if the image has, for example, a 3: 1 ratio - horizontal scrolling appears, how can you avoid it?

And one more bug with this approach - when the browser window is resized, minHeight and maxHeight do not change.

Tried to use

 $(window).resize(function () { $.fancybox.update(); }) 

Does not help:(

    1 answer 1

     minHeight: 900, maxHeight: 900, 
    • one
      Welcome to Stack Overflow in Russian ! Please try to leave a little more detailed answers. - aleksandr barakin 6:49 pm
    • Try to write more detailed answers. Explain what is the basis of your statement? - Nicolas Chabanovsky