Demo: LINK
Source: LINK
The most important part is this function:
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
changeCSS: function(cssFile, cssLinkIndex) { | |
var oldlink = document.getElementsByTagName("link").item(cssLinkIndex); | |
var newlink = document.createElement("link"); | |
newlink.setAttribute("rel", "stylesheet"); | |
newlink.setAttribute("type", "text/css"); | |
newlink.setAttribute("href", cssFile); | |
document.getElementsByTagName("head").item(0).replaceChild(newlink, oldlink); | |
} |
I know there is improvement to be done while the new css is beeing applied but I think you can do it on your own ;)
Keine Kommentare:
Kommentar veröffentlichen