Colorbox wrong height when first opened / scrollbars appear

Colorbox seems to have a strange issue – if it contains image(s), when opened for the first time, sometimes it opens with the wrong height set so scrollbars appear. I’m not sure what causes this, as in my case I had width and height properties set to all images AND the images I tested with were already loaded by the browser.

Solution / workaround: trigger resize after colorbox has loaded.

onComplete: function() {
    $.colorbox.resize();
},

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>