Created
April 27, 2018 13:12
-
-
Save jguadagno/7dc5f2b1d2196a3b2037dad7dd8668bc to your computer and use it in GitHub Desktop.
Bootstrap Theme Switch - Javascript
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
$().ready(function() { | |
/* For theme switching */ | |
var themeName = $.cookie("themeName"); | |
var themePath = $.cookie("themePath"); | |
if (themeName !== undefined) { | |
setTheme(themeName, themePath); | |
} | |
}); | |
function setTheme(themeName, themePath) { | |
var cssLink = ""; | |
$('#bootstrapTheme').replaceWith(cssLink); | |
$.cookie("themeName", themeName, { expires: 7, path: "/" }); | |
$.cookie("themePath", themePath, { expires: 7, path: "/" }); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment