I\'ve got a slideshow running in a container and need the height of the container to match the visible slide\'s height. Unfortunately the images are absolutely positioned and th
I found this to work well:
$(window).load(function() {
var imageHeight = $(".image-box img").height();
$(".image-box img").parent().css('height', imageHeight);
});
$(window).resize(function() {
var imageHeight2 = $(".image-box img").height();
$(".image-box img").parent().css('height', imageHeight2);
});
Where ".image-box" is the container for your images.
I also added this to my CSS for responsiveness:
.image-box img{
max-width: 100%;
height:auto !important;
}