Encountered a problem that required a long width to get the picture. In IE, Firefox are normal, on the TMD in Chrome, no one on the internet to say can, and then comes down to is not a chrome version of the problem.
Finally, finally, found the answer.
In most cases, place the JS code behind the picture label:
Copy Code code as follows:
<script>
Alert (document.getElementById ("test"). Width;<pre class=html name= "code" ></script></PRE>
<PRE></PRE>
This will get the width of the picture, but not under Chrome.
<P></P>
<P> even:</p> in jquery
<P></P>
<pre class=html name= "code" >$ (document). Ready (function () {
Alert (document.getElementById ("Test"). Width;
});</pre><br>
So, Chrome said no, I c.
<P></P>
<P> then, only the following methods of Chrome nod:</p>
<p style= "Text-align:left" ><span style= "line-height:21px" ></SPAN></P>
<pre class=html name= "code" >$ (window). Load (function () {
Alert ($ ("#test"). width ());
});</pre><br>
<BR>
<P></P>
<P><BR>
<BR>
</P>
<P><BR>
</P>
<PRE></PRE>
<PRE></PRE>
<PRE></PRE>