X-Git-Url: https://code.wpia.club/?p=gigi.git;a=blobdiff_plain;f=static%2Fstatic%2Fmenu.js;h=023e62440757526865c0a33e05b8fdcf948d0526;hp=12c3a30fe6ba5b73756fa5bcc350e7b1037f7ff1;hb=2fb0af2c1dd48272ffcc1d501324ff1f609331d4;hpb=7f22ccdc95d968a3f8a5affcab74687c22823d74 diff --git a/static/static/menu.js b/static/static/menu.js index 12c3a30f..023e6244 100644 --- a/static/static/menu.js +++ b/static/static/menu.js @@ -1,9 +1,9 @@ (function() { function explodeMenu(e) { - if (document.getElementById(e).className == 'menu hidden') { - document.getElementById(e).className = 'menu'; + if (e.className == 'menu hidden') { + e.className = 'menu'; } else { - document.getElementById(e).className = 'menu hidden'; + e.className = 'menu hidden'; } } @@ -13,11 +13,11 @@ for (var i = 0; i < max; i++) { var nodeObj = Nodes.item(i); if (nodeObj.className.indexOf("menu") > -1 && nodeObj.id != "recom") { - nodeObj.previousSibling.previousSibling.onclick = (function(nid) { + nodeObj.previousSibling.previousSibling.onclick = (function(node) { return function() { - explodeMenu(nid); + explodeMenu(node); }; - })(nodeObj.id); + })(nodeObj); } } } @@ -55,4 +55,4 @@ } })(window.onload); -})(); \ No newline at end of file +})();