Skip to content

Instantly share code, notes, and snippets.

@maxxcrawford
Last active December 21, 2015 21:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxxcrawford/6370425 to your computer and use it in GitHub Desktop.
Save maxxcrawford/6370425 to your computer and use it in GitHub Desktop.
Colorbox Responsive Resizer
/* Colorbox resize function */
var resizeTimer;
function resizeColorBox()
{
if (resizeTimer) clearTimeout(resizeTimer);
resizeTimer = setTimeout(function() {
if (jQuery('#cboxOverlay').is(':visible')) {
jQuery.colorbox.load(true);
}
}, 300)
}
$(window).resize(function() {
resizeColorBox();
});
window.addEventListener("orientationchange", resizeColorBox, false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment