getComputedStyle () listet die gestrichelten CSS -Eigenschaften in Chrom nicht auf < /p>
:root {
--test: #000;
}
< /code>
let cs = window.getComputedStyle(document.documentElement);
// works
console.log(cs.getPropertyValue('--test'));
// doesn't work
for (let i of cs) {
if (i.indexOf('--') == 0) {
console.log(i);
}
}
< /code>
https://jsfiddle.net/4kLv716o/
I read the docs (https://googlechrome.github.io/samples/ ... index.html) and I tried SO suggestions. I want to fix the above snippet for Chrome.
GetComputedStyle () indexiert gestrichelte Eigenschaften in Chrome nicht ⇐ JavaScript
-
- Similar Topics
- Replies
- Views
- Last post