Looks like this question has been asked before, here, but the asker solved his own question by switching to prettyPhoto. I'd prefer to figure out why this is happening, just to understand, but I will switch if there doesn't seem to be a solution. There is also setting overflow:hidden
, as noted in one of the answers, but I'm wondering if I can't just resize the box, instead of cutting off my images.
I am using fancybox 1.3.4 with the patch as described in this stackoverflow article.
All the files I'm using (css, js, images) that come with the fancybox zip, are in the asset pipeline, and are unchanged, other than changing the image paths in the css file in order to use the images properly in rails' asset pipeline, using the rails image-url helper. I can post the css, but I do not believe it will be helpful (I could be wrong). I'm using the jQuery that comes with rails 4.
DOCTYPE is html.
My application.js file looks like:
//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require jquery.easing-1.3.pack
//= require jquery.fancybox-1.3.4
$(document).ready(function(){
$("a.image-gallery").fancybox({
'width': 640,
'height':480,
'autoScale':true,
'autoDimensions':false
});
});
However, the images I've put into my lightbox gallery are overflowing off of the right side of the lightbox. You can see what I am talking about on firefox 25, here. Click on one of the first two images to see this problem.
For reference, my images are 640x480 pngs.
What steps can I take to rectify this problem?