Skip to content

Instantly share code, notes, and snippets.

@joshuabaker
Created May 7, 2011 22:16
Show Gist options
  • Save joshuabaker/960901 to your computer and use it in GitHub Desktop.
Save joshuabaker/960901 to your computer and use it in GitHub Desktop.
Move CSS inline
$.fn.inlineCSS = function() {
var self, style, prop, props;
return this.each(function() {
self = $(this);
style = this.style;
props = [];
for (prop in style) {
if (self.css(prop))
props.push(prop + ':' + self.css(prop));
}
this.style.cssText = props.join(';');
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment