I am not sure if this is a support request, feature request or bug.
I am using emimage, which uses colorbox-load to load an iframe.
I have two related problems.
A. The aspect ratio of the colorbox is not maintained as the browser window is resized.
Suppose this is the url I pass to colorbox:
http://mysite.com/foo.jpg?iframe=true&width=300&height=600
When the user resizes the browser window, the image and colorbox-height scale, but the colorbox-width remains at 300. And so the aspect ratio of the colorbox-window does not generally match the aspect ratio of the image.
B. The image is not centered in the colorbox-window
The image floats left inside the colorbox-window.
Colorbox adds this css to cboxContent:
element.style {
float:left;
height:293px; // recalculated as user resizes browser window
width:300px; // the original width, passed as attribute in url's query string
}
Ideally, I would like to have a way to address both problems:
A. maintain aspect ratio of colorbox window, as browser window is resized.
B. center the image within the colorbox window.
If (A) is not possible, then (B) will suffice.
Thanks very much for any help or advice!
Comments
Comment #1
kobnim commentedYikes.
I got an error message the first time I submitted this issue .... and the second time ... and now I see that all three copies were in fact submitted! And I don't see a way to delete the redundant copies. Sorry about that.
Comment #2
frjo commentedWhen I test in Firefox and Safari on Mac OS X I can't get the Colorbox to resize when I resize the browser window. As far as I know this is not a feature that exist in the Colorbox plugin by default.
Only content in iframes are set to float left by the Colorbox plugin. If you remove "iframe=true&" from the link the image will be centred.
Iframes is for HTML documents, to open an image there is no need to use an iframe.
Comment #3
kobnim commentedI removed "iframe=true" from the query string, and it now works perfectly. Thank you!!