March 4, 2012
Opening a fancyBox with a certain aspect ratio
Question by smares
Does anyone know how I can open a resizable fancyBox with a certain aspect ratio (for example 16:9)?
Answer by Adam Prax
There isn’t a native way of easily resizing Fancybox. You can do some simple math with screen.height to open a Fancybox in a particular aspect ratio relative to the current screen resolution.
height = screen.height/4;
$("#test").fancybox({
'width' : 16/9. * height,
'height' : height,
'autoDimensions' : false
});
});
Answer by Starx
AFAIK, Fancybox right now, does not support this. However, You can control the dimension of fancy box size
("#yourbox").fancybox({
'width' : 680,
'height' 495,
'showCloseButton' : false,
'titlePosition' : 'inside',
'titleFormat' : formatTitle
});