I'm having a problem with Chrome recognizing the width or height of the image after loading the DOM. The image is dynamically loaded through a phpThumb script (which resizes the image). If I pick up the dynamic url and just replace it with the direct url of the image, I don't get any problems and everything works in Chrome, but with the dynamic url, chrome doesn't seem to be able to calculate the width or height of the image.
Does anyone have any experience? He makes my head.
This code:
var theImage = new Image();
theImage.src = $image.attr('src');
var imgwidth = theImage.width;
var imgheight = theImage.height;
Where imgwidth = 0; for chrome, but IE, Firefox report the correct size.
source
share