It is simply disabling and enabling different style tag at run time.
Say there are two themes represented by styleSheets[0] (GREEN) & styleSheets[1] (BLUE)
<script>
function removeStyles() {
document.styleSheets[0].disabled = true;
document.styleSheets[1].disabled = true;
}
function applyGreenStyle() {
removeStylesStyles()
document.styleSheets[0].disabled = false;
}
function applyBlueStyle() {
removeStylesStyles()
document.styleSheets[1].disabled = false;
}
</script>
Say there are two themes represented by styleSheets[0] (GREEN) & styleSheets[1] (BLUE)
<script>
function applyGreenStyle() {
function applyBlueStyle() {
No comments:
Post a Comment