Может быть, вам следует использовать setInterval (100):
setInterval(100);
var defaults = {
height:null,
minHeight: 0,
maxHeight: null
};
Или, если вы можете перехватить событие изменения размера изображения, используйте глобальную переменную, чтобы гарантировать изменение размера изображения и setInterval
--- Обновить
Вы можете попробовать это:
function func(obj, options) {
//cache the children (is this the parent or a group of elements)
var children = (obj.length > 1) ? obj: obj.children();
if(options.height !== null){
//if specific height is set
children.height(options.height);
}else{
//set the height to auto which releases the boxes heights
children.css('height', 'auto');
//loop though the elements and get their heights
children.each(function () {
//if bigger than the default set to default
if ($(obj).height() > options.minHeight) options.minHeight= $(obj).height();
//if maxheight is set
if(options.maxHeight !== null){
if(options.minHeight > options.maxHeight) options.minHeight= options.maxHeight;
}
});
//set the height on all the children
children.height(options.minHeight);
}
return obj;
}
//this closure reserves the $.
(function ($) {
$.fn.extend({
equalHeight: function (options) {
//set default height to 0 or auto
var defaults = {
delay = false;
delayCount = 0;
height:null,
minHeight: 0,
maxHeight: null
};
//merge options
options = $.extend(defaults, options);
//delay
if (delay)
return setTimeout(func, delayCount);
}
});
})(jQuery);
Используйте следующее для запуска с задержкой
$('#parent').equalHeight({ delay: true, delayCount: 100});