I have previously written a Js function for proportional scaling of images. The defect is that proportional scaling can be performed only after all images are loaded. Yesterday, we used the jQuery plug-in aeImageResize to find it more advantageous: after each image is loaded, it will immediately perform proportional scaling.
This is attributed to the onload of the Image object loading event.
Check the source code of the plug-in and find that it also depends on the complete attribute of the image object and the onload event, and especially treats IE6 differently. In the end, IE6 is on the image loading object, what is the difference with other browsers?
See the following:
JavaScript code is used to manipulate DOM. In many cases, it is used to asynchronously load html elements on the current page. I will talk about some of the Image objects.
Let's look at an example:
The Code is as follows: