Created
January 26, 2009 03:18
-
-
Save os0x/52682 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function addCSS (css){ | |
if (document.createStyleSheet) { // for IE | |
var sheet = document.createStyleSheet(); | |
sheet.cssText = css; | |
return sheet; | |
} else { | |
var sheet = document.createElement('style'); | |
sheet.type = 'text/css'; | |
var _root = document.getElementsByTagName('head')[0] || document.documentElement; | |
sheet.textContent = css; | |
return _root.appendChild(sheet).sheet; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment