MediaWiki:Common.js/lightswitch.js: Difference between revisions

From The Official Visionaire Studio: Adventure Game Engine Wiki
No edit summary
No edit summary
Line 1: Line 1:
if($.cookie("css")) {
if($.cookie("css")) {
$("link").attr("href",$.cookie("css"));
$(".switchTheme").attr("href",$.cookie("css"));
}
}



Revision as of 23:22, 5 November 2014

if($.cookie("css")) {
	$(".switchTheme").attr("href",$.cookie("css"));
}

$(document).ready(function() { 

	$("#switchLight").click(function() { 
            $("#switchLight").hide();
            $("#switchDark").show();
            $(".switchTheme").attr("href",$(this).attr('rel'));
	    $.cookie("css",$(this).attr('rel'), {expires: 365, path: '/'});
	    return false;
	});

	$("#switchDark").click(function() { 
            $("#switchDark").hide();
            $("#switchLight").show();
            $(".switchTheme").attr("href",$(this).attr('rel'));
	    $.cookie("css",$(this).attr('rel'), {expires: 365, path: '/'});
	    return false;
         });

});