I create my own Switcher jQuery, and I want to remove class when click on another color, for example : I have "blue" class on body tag and when someone click on red should remove the blue class and replace it with red class etc..
Code :
$("body").addClass("wide light blue");
// Switcher jQuery Plugin
$(".switcher-toggle").click(function() {
$("#switcher").toggleClass("open");
});
// Theme Layout Switch
$(".layout").change(function() {
var layout = $(".layout").val();
$(".wrapper").css("width",layout);
});
// Theme Skins Switch
$(".skins").change(function() {
var skin = $(".skins").val();
$("body").toggleClass(skin);
});
// Theme Colors Switch
$(".colors span").each(function() {
var data_color = $(this).attr("data-color");
$(this).click(function() {
$("body").toggleClass(data_color);
});
});