The story mode implementation is to load only the current browsing photos and the two photos below it, loading and rendering the comment area, the picture is not loaded with a pixel image placeholder, and a loading class will display a loading background map, When the image is replaced with a real picture in the visual area, the loading class is deleted after the picture has been successfully loaded.
The problem is the last side, the test found in IE under the loading class can not be deleted, the code is as follows:
Copy Code code as follows:
IMG.SRC = _SRC;
IMG.SRC = _SRC;
Img.onload = function () {
_con.delclass (' loading ');
}
Online search, onload and definition of SRC statements should be changed order, ie from the cache to take pictures, the onload does not trigger, opera also has this problem, the correct code to modify the following
Copy Code code as follows:
Img.onload = function () {
_con.delclass (' loading ');
};
IMG.SRC = _SRC;
Immediately, it's normal.
Conclusion: The onload should be written in front of SRC, first tell the browser picture loaded to do how to deal with, and then let it to load pictures. So, not IE browser does not trigger the OnLoad event, but because the buffer is loaded too fast, it has been loaded without telling it what to do after loading. Conversely, Firefox is significantly more intelligent, after adding the onload event, the Firefox browser will detect whether the buffer has this image, and some words directly triggered this event!