For some off reason I have caption text overlaying atop text. I think it's a problem with the image-caption-container's height being set.

Live Example
http://www.ivawbeta.org/blogs/test-blog-wcaption

Anyone experienced this before?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bryancasler’s picture

This post resolved my issue, but I think this bug report should remain open.

http://drupal.org/node/368459#comment-1263415

WiredEscape’s picture

I had problem where .image-caption-container height was set to image height which did not push wrapped text down to accomodate caption. This caused caption to overlay text. Solution was to add following to css.

.image-caption-container {height: auto !important;}

Tested in Firefox & IE8

paularmand’s picture

Version: 6.x-2.5 » 7.x-1.0-beta3

Can also be resolved by calculating the heights for the parent container element.
In order to do so, make sure the following line is from the next patch is added in the file image_caption.js (near button):
----
$diff -u image_caption.js_orig image_caption.js > recalculate_height_of_parent_container.patch
$ cat recalculate_height_of_parent_container.patch
--- image_caption.js_orig 2012-04-06 00:09:33.235980418 +0200
+++ image_caption.js 2012-04-06 00:48:51.453979593 +0200
@@ -43,6 +43,9 @@
}
// Append caption
$(this).parent().append("" + captiontext + "");
+
+ // Resize the height of the parent container after the caption is added
+ $(this).parent().css('height', $(this).height() + $(this).next().height() );

// Add class to prevent duplicate caption adding
$(this).addClass('caption-processed');
---

Don't forget to minimize it, or rename it as a fall-back option:
$ mv image_caption.js image_caption.min.js

Worked for me and for alignment right scaled images.

acbramley’s picture

Issue summary: View changes
Status: Active » Needs review
FileSize
3.8 KB

Have rolled #3 into a patch along with some whitespace fixes that automatically come from my sublime set up. A colleague suggested removing the minified version entirely since this is a tiny module and having a minified version only makes it harder to maintain. Patch attached removes the minified file and fixes the hook_init().

bburg’s picture

Tried patch in #4, and it seems to work most the time. But about half the time, the image gets set to a very low height (2 pixels). Which makes me think some race condition is happening, but I don't see any asynchronous code in the js. So it's most likely a strange interaction of code specific to this site I am working on...

FWIW The generated element could use some margin or padding.

leisurman’s picture

THank you # 2 works!!!
add the class
.image-caption-container {height: auto !important;}