【发布时间】:2015-10-08 23:30:53
【问题描述】:
如果我们只能使用getComputedStyle 方法,你能告诉我为什么我们需要使用getPropertyValue 方法吗?
例如,据我了解,这将起作用:
var s = getComputedStyle(element, null).opacity;
相当于如下:
var s = getComputedStyle(element, null).getPropertyValue('opacity');
我们可以在没有getPropertyValue 的情况下使用getComputedStyle 吗?
【问题讨论】:
-
getComputedStyle的第二个参数也不再需要了。
标签: javascript css cssom