colorize code problem
3 posters
Page 1 of 1
colorize code problem
@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:
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>
Re: colorize code problem
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.
Similar topics
» Colorize the code tags
» Welcome code problem
» Problem in this code
» what is the problem in this JS code
» I have a problem in this code ..
» Welcome code problem
» Problem in this code
» what is the problem in this JS code
» I have a problem in this code ..
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum