Search code examples
jquery-pluginsfancyboxautosize

Fancybox wrapper not auto-sizing correctly to image dimensions


I'm having an issue with FancyBox. It's supposed to auto-resize the wrapper in accordance to the dimensions of the image. It's not doing that. Specifically it's too small.

Here's the FancyBox jQuery code I've used:

$("a[rel=photo_gallery]").fancybox({
    'type'              : 'image',
    'padding'           : 10,
    'autoScale'         : true,
    'cyclic'            : true,
    'overlayOpacity'    : 0.7,
    'overlayColor'      : '#000000',
    'transitionIn'      : 'fade',
    'transitionOut'     : 'fade',
    'titlePosition'     : 'over',
    'titleShow'         : false,
    'resize'            : 'Auto'
});

Has anyone else ever run into this issue?

Thanks in advance for any help.


Solution

  • Above did not work for me (FB 3beta).

    This is my solution:

    .fancybox-wrap, .fancybox-wrap *{
        -moz-box-sizing: content-box !important;
        -webkit-box-sizing: content-box !important;
        -safari-box-sizing: content-box !important;
        box-sizing: content-box !important;
    }