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.
Figured it out ...
It was my CSS reset that was being tripped-up by the FancyBox CSS. I reset the box-sizing style of DIV's to 'border-box'.
The fix was to go into the FancyBox CSS and declare the wrap, outer, and inner DIV's box-sizing to be 'content-box'.
Like so:
#fancybox-wrap {
position: absolute;
top: 0;
left: 0;
margin: 0;
padding: 20px;
z-index: 1101;
display: none;
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box;
-safari-box-sizing: content-box;
box-sizing: content-box;
}
#fancybox-outer {
position: relative;
width: 100%;
height: 100%;
background: #FFF;
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box;
-safari-box-sizing: content-box;
box-sizing: content-box;
}
#fancybox-inner {
position: absolute;
top: 0;
left: 0;
width: 1px;
height: 1px;
padding: 0;
margin: 0;
outline: none;
overflow: hidden;
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box;
-safari-box-sizing: content-box;
box-sizing: content-box;
}
Hopefully that will help somebody else that runs into this.
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;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With