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: | ||
$( document ).ready(function() { | $( document ).ready(function() { | ||
var cookie_monster = $.cookie('name'); | var cookie_monster = $.cookie('name'); | ||
if (cookie_monster == | if (cookie_monster == true) | ||
{ | { | ||
$.cookie('name', true); | |||
$("body").css("background", "#000000"); | |||
} else { | } else { | ||
$.cookie('name', false); | |||
$("body").css("background", "#ffffff"); | |||
} | } | ||
$( "#switchLights" ).click(function() { | $("#switchLights").click(function() { | ||
if (cookie_monster == true) | |||
{ | |||
$.cookie('name', false); | |||
$("body").css("background", "#ffffff"); | |||
} else { | |||
$.cookie('name', 'darkmode'); | |||
$("body").css("background", "#000000"); | |||
} | |||
}); | }); | ||
}); | }); | ||
Revision as of 18:26, 5 November 2014
$( document ).ready(function() {
var cookie_monster = $.cookie('name');
if (cookie_monster == true)
{
$.cookie('name', true);
$("body").css("background", "#000000");
} else {
$.cookie('name', false);
$("body").css("background", "#ffffff");
}
$("#switchLights").click(function() {
if (cookie_monster == true)
{
$.cookie('name', false);
$("body").css("background", "#ffffff");
} else {
$.cookie('name', 'darkmode');
$("body").css("background", "#000000");
}
});
});