javascript - How to get computed style of a HTMLElement - Stack Overflow

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.

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.

Share Improve this question asked Oct 17, 2010 at 13:18 guilin 桂林guilin 桂林 17.4k30 gold badges97 silver badges148 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 4

Take a look at:

  • Get the rendered style of an element

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

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

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745383100a4625320.html

相关推荐

  • javascript - How to get computed style of a HTMLElement - Stack Overflow

    no jQuery. pure javascript.e.g. Use element.height but I got nothing.I ever seen code like below befow:

    8小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信