I’m trying to make a stylesheet switcher in jquery with a success but when I try to save the changes in a cookie using jquery.cookie plugin, it doesnt work..
here’s the jquery code:
$("#theme-cp ul li").click(function () {
var $pattern = $(this).css("background-image");
$("body").css("background-image",$pattern);
$("#main-wrapper").css("background-image",$pattern);
$.cookie('background',$pattern);
alert($.cookie('background'));
});
the alert is for a check but it doesnt work….
I have recently done the same thing, i got it working, thought i’d share my code with you.
jsFiddle
jQuery
CSS
HTML