MediaWiki:Common.js/lightswitch.js: Difference between revisions
From The Official Visionaire Studio: Adventure Game Engine Wiki
No edit summary |
No edit summary |
||
| Line 2: | Line 2: | ||
// $(".toggleTheme").attr("href",$.cookie("css")); | // $(".toggleTheme").attr("href",$.cookie("css")); | ||
//} | //} | ||
$(document).ready(function() { | $(document).ready(function() { | ||
$("#switchLights").click(function() { | $("#switchLights").click(function() { | ||
if($.cookie("css")) { | if($.cookie("css")) { | ||
$("body").css({background:, "#ffffff"}); | |||
$("body").css( | $.cookie("css", null, {expires: 365, path: '/'}); | ||
$.cookie("css",null, {expires: 365, path: '/'}); | |||
} else { | } else { | ||
$("body").css({background:, "#000000"}); | |||
$("body").css( | $.cookie("css", "true", {expires: 365, path: '/'}); | ||
$.cookie("css","true", {expires: 365, path: '/'}); | |||
return false; | return false; | ||
} | } | ||
Revision as of 21:11, 5 November 2014
//if($.cookie("css")) {
// $(".toggleTheme").attr("href",$.cookie("css"));
//}
$(document).ready(function() {
$("#switchLights").click(function() {
if($.cookie("css")) {
$("body").css({background:, "#ffffff"});
$.cookie("css", null, {expires: 365, path: '/'});
} else {
$("body").css({background:, "#000000"});
$.cookie("css", "true", {expires: 365, path: '/'});
return false;
}
});
});
/*
$( document ).ready(function() {
var cookie_monster = $.cookie('name');
var dark = null;
if (cookie_monster)
{
dark = true;
$.cookie('name', 'true');
$("body").css("background-color", "#000000");
} else {
dark = false;
$.cookie('name', null);
$("body").css("background-color", "#ffffff");
}
});
$("#switchLights").click(function() {
if (dark) {
{
$("body").css({background-color: "#ffffff"});
$.cookie('name', null);
dark = false;
} else {
$("body").css({background-color: "#000000"});
$.cookie('name', 'true');
dark = true;
}
});
*/