Advertisement
salmancreation

Color switcher for theme or template

Aug 29th, 2023
1,054
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function ($) {
  2.   "use strict";
  3.  
  4.   // boxed layout switcher
  5.   if ($(".boxed-switcher").length) {
  6.     $(".boxed-switcher").on("click", function () {
  7.       $("body").toggleClass("boxed-wrapper");
  8.     });
  9.   }
  10.  
  11.   // color switcher
  12.  
  13.   if ($("#styleOptions").length) {
  14.     var cssPath = $("#styleOptions").data('css-path');
  15.     $("#styleOptions").styleSwitcher({
  16.       hasPreview: false,
  17.       fullPath: cssPath,
  18.       defaultThemeId: 'aivons-color-scheme-css',
  19.       cookie: {
  20.         expires: 999,
  21.         isManagingLoad: true
  22.       }
  23.     });
  24.   }
  25.  
  26.   if ($(".style-switcher").length) {
  27.     $("#switcher-toggler").on("click", function (e) {
  28.       e.preventDefault();
  29.       $(".style-switcher").toggleClass("active");
  30.     });
  31.   }
  32.  
  33. })(jQuery);
Tags: Color
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement