Resizing photos on windows resize

Calling $colorbox.resize() is not resizing photos inside container.
This code allow that.

Function to make call to resize is:

var timeoutId;
$(window).resize(function(){
	if (timeoutId) {
		clearTimeout(timeoutId);
	}

	timeoutId = setTimeout(function() {
		if ($('#colorbox:visible').length) {
			$.colorbox.resize({
				width: '90%',
				height: '90%',
				maxHeight: 500,
				maxWidth: 1200
			})
		}
	}, 250);
});