I had a similar situation, and I used the setTimeout function to give colorbox some time to load, and then called the resize method.
I called colorbox
var profileHeight=jQuery('#profile').height(); //Get the height of the container setTimeout(function (){ jQuery.colorbox({ html:jQuery('#profile').html(), width:'50%', height:profileHeight, opacity:0.5})} , 600); //Wait 700ms then resize setTimeout(function(){jQuery(this).colorbox.resize();},700);
This provided me with the functionality I needed. The modal window always resizes the contents of the container
joshgk00
source share