Working example
I think I developed compatibility issues and set a maximum height of 300 pixels, with a workaround for IE6.
JS:
$(document).ready(function () { $('.popup-with-zoom-anim').magnificPopup({ type: 'inline', fixedContentPos: false, fixedBgPos: true, overflowY: 'auto', closeBtnInside: true, preloader: false, midclick: true, removalDelay: 300, mainClass: 'my-mfp-zoom-in' }); }); // Handles the resize event $(window).resize(fn_resizeImage); $('.popup-with-zoom-anim').click(fn_resizeImage); // Resizes the content2 to fit with image height function fn_resizeImage() { var imgHeight = $('div.image_container > img').outerHeight(true); var cnt1Height = $('div.content > div.content1').outerHeight(true); var cnt2 = $('div.content > div.content2').outerHeight(imgHeight - cnt1Height); }
CSS
img { width: 300px; } .view_container { max-height:100%; max-width: 850px; _width:expression(this.scrollWidth > 850 ?"850px" :"auto"); margin: 20px auto; background-color: #1C1C1C; padding: 0; line-height: 0; border: 1px solid red; } .image_container, .content { width: 50%; float: left; } .image_container img { max-height:300px; _height:expression(this.scrollWidth > 300 ?"300px" :"auto"); max-width: 100%; _width:expression(this.scrollWidth > 850 ?"850px" :"auto"); } .image_container { text-align: center; } .content1, .content2 { background-color: #fff; padding: 1em; } .content { line-height: 1.231; } .content2 { height: 300px; overflow-y: scroll; } #small-dialog { max-width: 850px; _width:expression(this.scrollWidth > 850 ?"850px" :"auto"); margin: 20px auto; background-color: #1C1C1C; padding: 0; line-height: 0; border: 1px solid red; } @media (min-width: 1px) and (max-width: 638px) { .image_container, .content { width: auto; float: none; clear: both; } .image_container img { max-height:150px; max-width:150px; _height:expression(this.scrollWidth > 150 ?"150px" :"auto"); _width:expression(this.scrollWidth > 150 ?"150px" :"auto"); } }
apaul source share