Suppose we have a page like the following:
In IE and When running under FF, the true size of the image can be displayed, even if I do not display the width and height of the img. But under chrome, it displays 0.
But if you change the new init() after window.onload to
window.onload=init
or
window.onload=function(){new init(){}}
You can read the size of the image after it is loaded.
Please keep the following information when reprinting
Author: Beiyu (tw:@rehawk)
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn