The onload event about the Image object.
What you want to get is the width and height value of the image. So use the OnLoad method. In addition, a remote picture is obtained.
But IE in the second display of pictures, always do not go to the OnLoad method. Code:
var img = new Image ();
IMG.SRC = "Loading.gif";
Img.onload = function () {
var iheight = img.height;
var iwidth = img.width;
Later to Xiaoniu students read, IMG.SRC should be placed in the OnLoad method behind.
Later Google, only to find that the original such problems are summed up. I'm a real amateur.
Because IE does not trigger the OnLoad method when loading the buffer data, it causes the code in the event to be ignored. FF triggers the OnLoad method when it loads the buffer data.
In fact, it is also a bit, is the onload when the picture to adapt to adjust, found that need to be in the onload also to set the element once img.src ... Or it just remembers the first picture ...
There is still a smattering of this buffer. Go on.