Created
March 8, 2011 13:56
-
-
Save oslego/860278 to your computer and use it in GitHub Desktop.
Load any number of CSS files to the current document's head.
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
//Loads CSS files into the head of the current document | |
//using arguments to reference any number of styles | |
function loadStyles(){ | |
var i = 0, | |
d = document, | |
s = d.createElement("link"), | |
h = d.getElementsByTagName('head')[0], | |
createStyle = function(src){ | |
s = s.cloneNode(false); | |
s.rel ="stylesheet"; | |
s.type = "text/css"; | |
s.href = src; | |
h.appendChild(s); | |
} | |
for (i; i < arguments.length; i++){ | |
createStyle(arguments[i]) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment