CodePudding user response:
Has been solved, detailed look at "javascript senior program design" in the first ten pages, <script> tag attributes deferCodePudding user response:
Your container is used up, when access to the container size may be the inside of the pictures haven't loaded, get less than the real size of images,Can be explicitly set the size of the image in code or container size, also can be in the window. The onl oad event scripts to defer attribute (equivalent),