Tag: phpthumb

jQuery的; 新图片的Chrome图片宽度和高度= 0()

我无法让Chrome在DOM加载后识别图像宽度或高度。 Image通过phpThumb脚本(调整图像大小)动态加载。 如果我拿走动态url并将其替换为图片的直接url我就没有问题,而且一切都在Chrome中运行,但是使用动态url时,Chrome似乎无法计算图像的宽度或高度。 有人对此有经验吗? 它正在努力。 有问题的代码是: var theImage = new Image(); theImage.src = $image.attr(‘src’); var imgwidth = theImage.width; var imgheight = theImage.height; 其中imgwidth = 0; 对于chrome,但IE,Firefox都报告了正确的大小。