X-Git-Url: http://git.jkinsey.net/?p=jkinsey.net.git;a=blobdiff_plain;f=js%2Fscript.js;h=e7ab2b64e94d2eccb94dcc67cfc36770def73e79;hp=6528aa3fffbec092eaebfd9b1da621006b290d08;hb=b0fbfd4fba15bb8d893a48806c30727ad4bb61d1;hpb=7fd558c20b12609cb49641770cb7a2a6416e3603 diff --git a/js/script.js b/js/script.js index 6528aa3..e7ab2b6 100644 --- a/js/script.js +++ b/js/script.js @@ -3,6 +3,7 @@ window.addEventListener('load', function() { var home = document.getElementsByClassName("home"); var menu = document.getElementById("menu"); var content = document.getElementById("content"); + var body = document.getElementsByTagName("body")[0]; var menuLoc = parseInt(getComputedStyle(menu).getPropertyValue("top")); function menuOperator(position, token="") { @@ -21,6 +22,10 @@ window.addEventListener('load', function() { var article = document.getElementById(name); article.setAttribute("class", "selected"); } + var color = node.getAttribute("data-color"); + if(color) { + body.setAttribute("class", color); + } window.history.pushState("object or string", "Title", node.href); }