0

我正在动态创建图像标签,并且在图像的加载事件中我想要图像的高度和宽度。

I have following code


 var foreImage = $('<img/>')
.load(function () {
    alert( this.height + '  ' +  this.width );
}).attr("src", imageUrl);

上面的代码在 Firefox 和 chrome 中工作,但在 IE 8 中它失败了。知道为什么吗?

4

0 回答 0