Image Alignment with Galleria.js in Opera Browser
I trust someone can help wi开发者_运维问答th my issue. I have a problem with users visiting my site (www.amigaos.net) using the popular Opera Browser; if someone would like to test in IE as well that would be great, but as a Mac user I avoid inferior browsers.
I am using Galleria v 1.1.95 and have Opera beta 11 installed, but I understand the layout problem (from user feedback) that it happens in previous versions as well.
So if you visit www.amigaos.net using Opera and click Games from the top menu, galleria.js loads the gallery and straightaway you should notice that the main gallery image is left-aligned in the stage which is incorrect behaviour. Both Safari and FireFox centre the image.
I don't know where I should be looking in galleria.classic.css, the html or the .js itself - how do I get Opera to correctly position the image in the centre of the stage? Advice please.
Thanks in advance.
The problem I see (image not appearing at all) is caused by Galleria.js setting a height:0. It fails to read the height of the stage (<div class="galleria-stage">
) in Opera - offsetHeight of this element returns 0 even after giving the parent an explicit height. (This turns out to be a known bug in Opera where a positioned child with top and bottom set still reports offsetHeight 0 if parent is given an explicit height.)
I guess the script could detect this. I'm not entirely sure why they need to read the height of this DIV since they know the height of its parent - but I guess it's done this way to make theming and styling more flexible.
I don't really have a good workaround for you - perhaps specifying .galleria-stage{min-height:100%} or setting its height explicitly from JS would do? I will however follow up the bug so it should get fixed at some point..
精彩评论