|
Post by Schubaltz on Feb 22, 2008 15:18:28 GMT -5
Description: Allows the user to display / hide categories by clicking their respective names. Source: Open Cross-browser: Yes Main Page Footer <script type="text/javascript"> <!-- // Expand and Collapse Categories
var cps = [ ], int; if(/com\/(\w+\.cgi)?\??(#.+|\w+=home)?$/i.test(location.href)) for(var l = document.links, k = 4; k < l.length; k ++) if(l[k].className == "nav") { for(var i = l[k].parentNode.getElementsByTagName("table")[1].rows, x = 1, a = 0; x < i.length; x ++) if(i[x].cells.length > 1) { cps[int].push(i[x]); } else if(i[x].cells[0].align != "right") { int = i[x].getElementsByTagName("b")[0]; int.onclick = function() { hideCategory(this.firstChild.data) } cps[int = int.firstChild.data] = [ ]; } if(document.cookie.match(/cat/)) { for(var i = document.cookie.split("cat"), x = 1; x < i.length; x ++) hideCategory(i[x].split("=")[0]); } } function hideCategory(a) { var i = cps, r = i[0].style.display; for(var x in i) i[x].style.display = (r ? "" : "none"); document.cookie = "cat" + a + "=true;expires=" + new Date("December 31, " + (r ? 2000 : 2050)).toGMTString() + ";"; } //--> </script>
|
|
|
Post by Jeeeeeel on Feb 23, 2008 18:41:10 GMT -5
Whoa Aaron! This code reminds me of a VBulletin message board.
|
|