colorize code problem Hitskin_logo Hitskin.com

This is a Hitskin.com skin preview
Install the skinReturn to the skin page

The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.
3 posters

    colorize code problem

    omarpop23
    omarpop23
    Forumember


    Male Posts : 182
    Reputation : 3
    Language : Arabic
    Location : Egypt

    colorize code problem Empty colorize code problem

    Post by omarpop23 November 22nd 2017, 3:19 am

    @Ange Tuteur i wrote a code to change my theme color and it works perfectly. but when i refresh page default theme back again

    i want to add cookies to save the color

    the code:
    Code:

      <style>
        #colors-menu ul li {
            display: inline-block;
            width: 12px;
            height: 12px;
            margin-left: 3px;
            cursor: pointer;
        } 
      </style>
      <div id="colors-menu">
        <ul>
          <li data-value="https://cdn.rawgit.com/Omarpop23/main/gh-pages/blue_style.css"></li>
          <li data-value="https://cdn.rawgit.com/Omarpop23/main/gh-pages/pink_style.css"></li>
          <li data-value="https://cdn.rawgit.com/Omarpop23/main/gh-pages/gray_style.css"></li>
          <li data-value="https://cdn.rawgit.com/Omarpop23/main/gh-pages/red_style.css"></li>
          <li data-value="https://cdn.rawgit.com/Omarpop23/main/gh-pages/green_style.css"></li>
        </ul>
      </div>
        <script>
    $(function () {

    var color = $('#colors-menu ul li');
      color.eq(0).css("background-color","#69c");
      color.eq(1).css("background-color","#c6c");
      color.eq(2).css("background-color","#808080");
      color.eq(3).css("background-color","#c66");
      color.eq(4).css("background-color","#6c6");
     
        color.click(function() {
                    $('head link[href*="style.css"]').attr('href', $(this).attr('data-value'));
      });
    });
    </script>
    Nyghtstrix
    Nyghtstrix
    New Member


    Male Posts : 24
    Reputation : 4
    Language : English

    colorize code problem Empty Re: colorize code problem

    Post by Nyghtstrix November 22nd 2017, 3:50 am

    I'm no expert on the issue, but did you add / change the code in a general template? Once you change it, you need to "Publish it" by ticking a green tick or something.
    skouliki
    skouliki
    Manager
    Manager


    Female Posts : 15311
    Reputation : 1705
    Language : English,Greek
    Location : Greece

    colorize code problem Empty Re: colorize code problem

    Post by skouliki November 22nd 2017, 7:45 am

    you can get info from here about how to set a cookie