Событие загрузки с ошибкой jquery в IE 8

Я написал плагин jquery для масштабирования изображения вверх. в случае 8 событие загрузки большой версии изображения выходит из строя. я пробовал как thsi:

        var fullImage = container.find(options.fullSelector);
        fullImage.attr('src', fullImageUrl).bind('load', function() {
            content.fadeOut(options.fadeSpeed, function(){
                if(slideContent.size()){
                    slideContent.slideUp(options.resizeSpeed, function(){
                        smallImage.hide();
                        fullImage.show();
                        fullImage.parent().andSelf().stop().animate({ width: options.fullWidth + 'px' }, options.resizeSpeed);
                    });
                }
                else{
                    smallImage.hide();
                    fullImage.show();
                    fullImage.parent().andSelf().stop().animate({ width: options.fullWidth + 'px' }, options.resizeSpeed);
                }
            });
        });

ошибка говорит: Object не поддерживает свойство или метод.

что я делаю неправильно?

Благодарю вас

Ответ 1

Сначала установите обработчик load, затем установите src.

fullImage.bind('load', function() {
   ...
}).attr('src', fullImageUrl);

Ответ 2

Как насчет этого?

var test = function($what) {
  $('#debug').html('Image loaded: '+$what.width+' x '+$what.height);
  console.log($what);
};
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script>
// Random image
var src = "http://placehold.it/300x" + Math.round(Math.random() * (310 - 100) + 100);
</script>
<div id="debug">Image loading:</div>    
<img onload="test(this)" id="img" />

<script>
$('#img')[0].src = src;
</script>