Skip to content

Instantly share code, notes, and snippets.

@jguadagno
Created April 27, 2018 13:12
Show Gist options
  • Save jguadagno/7dc5f2b1d2196a3b2037dad7dd8668bc to your computer and use it in GitHub Desktop.
Save jguadagno/7dc5f2b1d2196a3b2037dad7dd8668bc to your computer and use it in GitHub Desktop.
Bootstrap Theme Switch - Javascript
$().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