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:
             $("body").css({background:, "#000000"});
             $("body").css({background:, "#000000"});
             $(this).hide(); $('switchDark').show();
             $(this).hide(); $('switchDark').show();
             $.cookie("css", null, {expires: 365, path: '/'});
             //$.cookie("css", null, {expires: 365, path: '/'});
             return false;
             //return false;
});
});


Line 11: Line 11:
             $("body").css({background:, "#ffffff"});
             $("body").css({background:, "#ffffff"});
             $(this).hide(); $('switchLight').show();
             $(this).hide(); $('switchLight').show();
             $.cookie("css", null, {expires: 365, path: '/'});
             //$.cookie("css", null, {expires: 365, path: '/'});
             return false;
             //return false;
});
});



Revision as of 21:35, 5 November 2014

$(document).ready(function() { 

	$("#switchLight").click(function() { 
            $("body").css({background:, "#000000"});
            $(this).hide(); $('switchDark').show();
            //$.cookie("css", null, {expires: 365, path: '/'});
            //return false;
	 });

	$("#switchDark").click(function() { 
            $("body").css({background:, "#ffffff"});
            $(this).hide(); $('switchLight').show();
            //$.cookie("css", null, {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; 
                }
        });
*/