Home  >  Article  >  Web Front-end  >  jquery solves the problem of getting the length and width of images under Chrome_javascript skills

jquery solves the problem of getting the length and width of images under Chrome_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:40:061081browse

I encountered a problem where I needed to get the length and width of an image. It works fine under IE and FireFox, but it doesn't work in Chrome. Someone on the Internet said it can, and then it comes down to whether it is a problem with the Chrome version.
Finally, I found the answer.

In most cases, put the js code behind the image tag:

Copy the code The code is as follows :