[removed] Get typed CSS values NOT computed values

前端 未结 1 1669
野的像风
野的像风 2020-12-20 21:31

Obviously it can be done since Firebug does, but I wasn\'t sure if they were doing a lot of processing on the CSSDeclarations or if there was something in the DOM that I am

相关标签:
1条回答
  • 2020-12-20 22:19

    I actually found the answer I was looking for.

    cssText is what I was looking for. It's noted here: http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration

    The reason it wasn't working is because I was trying it when the page loaded, but it was being fired before the actual rendering occured, so it was returning undefined.

    I was doing some major revisions and tried it after the page finished loading completely, and it showed up.

    Yay!

    0 讨论(0)
提交回复
热议问题