MediaWiki:Common.js/lightswitch.js: Difference between revisions
From The Official Visionaire Studio: Adventure Game Engine Wiki
mNo edit summary |
No edit summary |
||
| Line 26: | Line 26: | ||
$("#switchLights").click(function() { | $("#switchLights").click(function() { | ||
$('body').toggle(function () { | $('body').toggle(function () { | ||
$("body").css({background: "#ffffff"}); $.cookie('name', null); | |||
$("body").css({background: "#ffffff"}); | |||
}, function() { | }, function() { | ||
$("body").css({background: "#000000"}); $.cookie('name', 'true'); | |||
$("body").css({background: "#000000"}); | |||
}); | }); | ||
}); | }); | ||
}); | }); | ||
Revision as of 19:42, 5 November 2014
$( document ).ready(function() {
var cookie_monster = $.cookie('name');
if (cookie_monster)
{
$.cookie('name', 'true');
$("body").css("background", "#000000");
} else {
$.cookie('name', null);
$("body").css("background", "#ffffff");
}
/*
$("#switchLights").click(function() {
if (cookie_monster == 'dark')
{
$.cookie('name', 'light');
$("body").css({background: "#ffffff"});
} else {
$.cookie('name', 'dark');
$("body").css({background: "#000000"});
}
});
*/
$("#switchLights").click(function() {
$('body').toggle(function () {
$("body").css({background: "#ffffff"}); $.cookie('name', null);
}, function() {
$("body").css({background: "#000000"}); $.cookie('name', 'true');
});
});
});