Kennt jemand eine gute Javascript-Bibliothek zu erhalten, original (d.h. nicht berechnet) Stil für ein bestimmtes Element im DOM? Mit anderen Worten, etwas könnte man verwenden, um die Ergebnisse in Firebug's Stil Registerkarte zu produzieren. Wie Firebug, sollte es berücksichtigen Vererbung, Shortcut-Eigenschaften und alle anderen Nuancen von CSS.
Antwort
Zu viele Anzeigen?Nach den Kommentaren zu urteilen, könnten Sie an einem schönen Firebug-Lite-Lesezeichen-Link interessiert sein:
http://www.latentmotion.com/how-to-use-firebug-in-ie6-and-all-other-browsers/
Bevor ich auf Firebug Lite gestoßen bin, habe ich mit meiner eigenen Version begonnen:
http://latentmotion.com/jquery-bookmarklet/
(Hinweis: Klicken Sie auf "Reveal Box Boundaries" und dann auf ein HTML-Tag auf der Seite. Auf der rechten Seite werden die Stileigenschaften angezeigt. Es kann auch als Bookmarklet verwendet werden)
Um das obige Bookmarklet zu erstellen, habe ich (Link und Array) verwendet:
http://www.latentmotion.com/jquery-bookmarklet/example-jquery-bookmarklet.js
var allStyles = ["azimuth","background" ,"backgroundAttachment","backgroundColor","backgroundImage","backgroundPosition","backgroundRepeat","border","borderBottom","borderBottomColor","borderBottomStyle","borderBottomWidth","borderCollapse","borderColor","borderLeft","borderLeftColor","borderLeftStyle","borderLeftWidth","borderRight","borderRightColor","borderRightStyle","borderRightWidth","borderSpacing","borderStyle","borderTop","borderTopColor","borderTopStyle","borderTopWidth","borderWidth","bottom","captionSide","clear","clip","color","content","counterIncrement","counterReset","cssFloat","cue","cueAfter","cueBefore","cursor","direction","display","elevation","emptyCells","font","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","height","left","letterSpacing","lineHeight","listStyle","listStyleImage","listStylePosition","listStyleType","margin","marginBottom","marginLeft","marginRight","marginTop","markerOffset","marks","maxHeight","maxWidth","minHeight","minWidth","orphans","outline","outlineColor","outlineStyle","outlineWidth","overflow","padding","paddingBottom","paddingLeft","paddingRight","paddingTop","page","pageBreakAfter","pageBreakBefore","pageBreakInside","pause","pauseAfter","pauseBefore","pitch","pitchRange","playDuring","position","quotes","richness","right","size","speak","speakHeader","speakNumeral","speakPunctuation","speechRate","stress","tableLayout","textAlign","textDecoration","textIndent","textShadow","textTransform","top","unicodeBidi","verticalAlign","visibility","voiceFamily","volume","whiteSpace","widows","width","wordSpacing","zIndex"];
Wenn jemand einen besseren Weg kennt, bin ich auch daran interessiert, ihn zu erfahren :)