开发者

How to get computed style of a HTMLElement

开发者 https://www.devze.com 2023-01-20 02:59 出处:网络
no jQuery. pure javascript. e.g. Use element.height but I got nothing. I ever seen开发者_运维问答 code like below befow:

no jQuery. pure javascript.

e.g. Use element.height but I got nothing.

I ever seen开发者_运维问答 code like below befow:

(ele.style || ele)[styleName]

but I forgot what it use to.


Take a look at:

  • Get the rendered style of an element


There are some pointers in http://www.quirksmode.org/dom/getstyles.html

also, google clientHeight offsetHeight and you will find info on height.

0

精彩评论

暂无评论...
验证码 换一张
取 消