MediaWiki:Common.js/lightswitch.js: Difference between revisions
From The Official Visionaire Studio: Adventure Game Engine Wiki
No edit summary |
No edit summary |
||
| Line 4: | Line 4: | ||
$("#switchLight").hide(); | $("#switchLight").hide(); | ||
$("#switchDark").show(); | $("#switchDark").show(); | ||
$("link").attr("href",$(this).attr('rel')); | $(".switchTheme link").attr("href",$(this).attr('rel')); | ||
$.cookie("css",$(this).attr('rel'), {expires: 365, path: '/'}); | $.cookie("css",$(this).attr('rel'), {expires: 365, path: '/'}); | ||
return false; | return false; | ||
| Line 12: | Line 12: | ||
$("#switchDark").hide(); | $("#switchDark").hide(); | ||
$("#switchLight").show(); | $("#switchLight").show(); | ||
$("link").attr("href",$(this).attr('rel')); | $(".switchTheme link").attr("href",$(this).attr('rel')); | ||
$.cookie("css",$(this).attr('rel'), {expires: 365, path: '/'}); | $.cookie("css",$(this).attr('rel'), {expires: 365, path: '/'}); | ||
return false; | return false; | ||
Revision as of 23:15, 5 November 2014
$(document).ready(function() {
$("#switchLight").click(function() {
$("#switchLight").hide();
$("#switchDark").show();
$(".switchTheme link").attr("href",$(this).attr('rel'));
$.cookie("css",$(this).attr('rel'), {expires: 365, path: '/'});
return false;
});
$("#switchDark").click(function() {
$("#switchDark").hide();
$("#switchLight").show();
$(".switchTheme link").attr("href",$(this).attr('rel'));
$.cookie("css",$(this).attr('rel'), {expires: 365, path: '/'});
return false;
});
});