likes
comments
collection
share

JavaScript通过style获取img的width和height时,获取不到

作者站长头像
站长
· 阅读数 16

JavaScript通过style获取img的width和height时,获取不到

  • 原因

    • img没有设置样式width和height
  • 解决办法

    • offsetWidth和offsetHeight
    • clientWidth和clientHeight