Compare Revisions

Window.getComputedStyle()

Revision 406827:

Revision 406827 by Sheppy on

Revision 438261:

Revision 438261 by Allasso on

Title:
window.getComputedStyle
window.getComputedStyle
Slug:
Web/API/window.getComputedStyle
Web/API/window.getComputedStyle
Tags:
"Fixit","Gecko DOM Reference","DOM","Gecko","CSSOM"
"Fixit","Gecko DOM Reference","DOM","Gecko","CSSOM"
Content:

Revision 406827
Revision 438261
tt74    <pre class="brush: js">
75function dumpComputedStyles(elem,prop) {
76 
77  var cs = window.getComputedStyle(elem,null);
78  if (prop) {
79    dump("    "+prop+" : "+cs.getPropertyValue(prop)+"\n");
80    return;
81  }
82  var len = cs.length;
83  for (var i=0;i&lt;len;i++) {
84 
85    var style = cs[i];
86    dump("    "+style+" : "+cs.getPropertyValue(style)+"\n");
87  }
88 
89}
90 
91</pre>

Back to History