I am using colorbox in a responsive website.
I have a request : I wish that Colorbox automatically adjusts itself to the size and orientation of the screen / mobile devi
Before colorbox js lock, insert the following code:
jQuery.colorbox.settings.maxWidth = '95%';
jQuery.colorbox.settings.maxHeight = '95%';
var resizeTimer;
function resizeColorBox()
{
if (resizeTimer) clearTimeout(resizeTimer);
resizeTimer = setTimeout(function() {
if (jQuery('#cboxOverlay').is(':visible')) {
jQuery.colorbox.load(true);
}
}, 300);
}
jQuery(window).resize(resizeColorBox);
window.addEventListener("orientationchange", resizeColorBox, false);
Leave left, right, bottom and top with value 'false' and it will do the calculation automatically. It worked for me so I'm going over!