X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=static%2Fstatic%2Fmenu.js;fp=static%2Fstatic%2Fmenu.js;h=b73827eb6383bcff219200ee841e4b615a04ca97;hb=d690eda36eba121aa79e4f456d5f0eb481be8b86;hp=0000000000000000000000000000000000000000;hpb=474942bce8bf8f8e4d777c93b332bc64fc724824;p=gigi.git diff --git a/static/static/menu.js b/static/static/menu.js new file mode 100644 index 00000000..b73827eb --- /dev/null +++ b/static/static/menu.js @@ -0,0 +1,35 @@ +(function() { + function explodeMenu(e) { + if (document.getElementById(e).className == 'menu hidden') { + document.getElementById(e).className = 'menu'; + } else { + document.getElementById(e).className = 'menu hidden'; + } + } + + function initMenu() { + var Nodes = document.getElementsByTagName('ul'); + var max = Nodes.length; + 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) { + return function() { + explodeMenu(nid); + }; + })(nodeObj.id); + } + } + } + (function(oldLoad) { + if (oldLoad == undefined) { + window.onload = initMenu; + } else { + window.onload = function() { + initMenu(); + oldLoad(); + } + } + })(window.onload); + +})(); \ No newline at end of file