The problem is that you need to obtain the length and width of the image. It works normally in IE and FireFox, so TMD won't work in Chrome. If no one on the internet says yes, it also comes down to the Chrome version issue.
Finally, I found the answer.
In most cases, place the js Code behind the Image Tag:
[Html]
<Script>
Alert (document. getElementById ("test"). width; <pre name = "code" class = "html"> </script>
<Script>
Alert (document. getElementById ("test"). width; <pre name = "code" class = "html"> </script>
In this way, the image width can be obtained, but not in Chrome.
In jquery:
[Html]
$ (Document). ready (function (){
Alert (document. getElementById ("test"). width;
});
$ (Document). ready (function (){
Alert (document. getElementById ("test"). width;
});
In this way, Chrome still says no, I am C.
Then, Chrome nodded only in the following method:
[Html]
$ (Window). load (function (){
Alert ($ ("# test"). width ());
});
$ (Window). load (function (){
Alert ($ ("# test"). width ());
});
From the cangkukuaimanle Column