@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>