User:Silverstrike/global.js

getSidebar = document.getElementById("WikiaRail"); getContent = document.getElementById("WikiaMainContent");

oSwitch= document.createElement("div"); oSwitch.setAttribute("id", "switch"); oSwitch.setAttribute("style", "padding:.5em;width:100%;cursor:pointer;display:block;"); oSwitch.innerHTML = "Show/Hide Sidebar"; getContent.insertBefore(oSwitch,getContent.firstChild);

document.getElementById("switch").onclick = function{ if(getSidebar.style.display == "block"){ getSidebar.style.display = "none"; getContent.style.width = "100%"; }else{ getSidebar.style.display = "block"; getContent.style.width = "680px"; } };