#00AF33
Official Code Helper
19529
0
1
Nov 19, 2012 14:18:28 GMT -8
Todge
**
17,324
January 2004
todge
|
Post by Todge on Dec 10, 2005 8:37:47 GMT -8
This will collapse a single category, clicking on the category bar will bring it into view..
It goes in your Main Footer..
<script type="text/javascript"> <!-- /* Collapse ONE catagory By Todge */
var catToCollapse = 'NAME OF CATEGORY TO COLLAPSE';
// Collapse or expand catagory.. function collapseCat(hiddenCat) { if(hiddenCat.nextSibling.style.display == 'none') { hiddenCat.firstChild.innerHTML = catToCollapse+'<font size="-2"> - Click to hide</font>'; } else { hiddenCat.firstChild.innerHTML = catToCollapse+'<font size="-2"> - Click to expand</font>'; } while(hiddenCat.nextSibling.firstChild.className != 'catbg' && hiddenCat != hiddenCat.parentNode.lastChild) { hiddenCat = hiddenCat.nextSibling; if(hiddenCat.style.display == 'none') { hiddenCat.style.display = ''; } else { hiddenCat.style.display = 'none'; } } }
// Find catagory and make it collapsable var cat=document.getElementsByTagName('tr'); for(c=0; c<cat.length; c++) { if(cat[c].firstChild.className=='catbg' && cat[c].firstChild.colSpan=='5' && cat[c].firstChild.innerHTML.match('>'+catToCollapse+'<')) { cat[c].style.cursor = 'pointer'; cat[c].onclick = function(){collapseCat(this);} collapseCat(cat[c]); } } // --> </script>
Edit this line with the EXACT name of the category you want collapsed..
var catToCollapse = 'NAME OF CATEGORY TO COLLAPSE';
|
|