To start off, gather all the styles you need, perform any desired actions, and then compare the two arrays. Here is a basic guide to help you begin:
An array containing all styles:
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…
Below is a jQuery loop that prints out the values after comparing them with another set of values (in this example, $other represents another DOM element, but the code can be adapted accordingly. Some modifications might be necessary):
// Iterate through each property and display those that are defined
$.each(allStyles, function(key, value){
if ($this.css(value) !== undefined){
if (($other.css(value) !== undefined) && ($this.css(value) !== $other.css(value))){
$("#jsStylesA").append("<li><span class='property'>"+value+"</span>: <span class='value'>"+$this.css(value)+"</span></li>");
}
else {
$("#jsStylesB").append("<li><span class='property'>"+value+"</span>: <span class='value'>"+$this.css(value)+"</span></li>");
}
}
});
Feel free to continue building on this foundation. Do you think you can handle it?