Post by iAlex on Dec 18, 2007 3:57:42 GMT -5
Ok, this code will allow you to Expand/Collapse your categories. Which basically means, if you click on a category bar all the boards in that category will be hidden, if you click on it again, then they will re-appear..... It will also remember the categories that you have expanded/collapsed.
Bleh, here is a preview: Clickies
Main Footer.
Cross Browser.
Open Source.
<script type="text/javascript">
<!--
/*Expand/Collapse Categories - By iAlex - Open Source*/
if(location.href.match(/action=home/) || !location.href.match(/action/) && !document.postForm && !document.modifyForm){
var iTd=document.getElementsByTagName('td');
var i=iTd.length;
while(--i){
if(iTd.item(i).className=="catbg" && iTd.item(i).colSpan=="5" && iTd.item(i).align!="right"){
var iMesSpan=document.createElement('span');
iMesSpan.innerHTML=' - <font size="1" style="cursor: pointer;">(Expand/Collapse)</font>';
iTd.item(i).appendChild(iMesSpan);
iMesSpan.onclick=function(){iCollapse(this);};
(document.cookie.match('iStart'+iTd.item(i).firstChild.name+'=iCollapsed'))? iCollapse(iMesSpan) : '';
}
}
}
function iCollapse(iSpan){
var iCatName=iSpan.parentNode.firstChild.name;
var iCell=iSpan.parentNode.parentNode.nextSibling;
(iCell.style.display=="none")? document.cookie='iStart'+iCatName+'=iCollapsed;expires=Sat, 20 Jan 1990 12:12:12 UTC; path=/;' : document.cookie='iStart'+iCatName+'=iCollapsed;expires=Sat, 20 Jan 2050 12:12:12 UTC; path=/;';
while(iCell.cells[0].className!="catbg"){
(iCell.style.display=="none")? iCell.style.display='' : iCell.style.display='none';
var iCell=iCell.nextSibling;
}
}
//-->
</script>
Bleh, here is a preview: Clickies
Main Footer.
Cross Browser.
Open Source.
<script type="text/javascript">
<!--
/*Expand/Collapse Categories - By iAlex - Open Source*/
if(location.href.match(/action=home/) || !location.href.match(/action/) && !document.postForm && !document.modifyForm){
var iTd=document.getElementsByTagName('td');
var i=iTd.length;
while(--i){
if(iTd.item(i).className=="catbg" && iTd.item(i).colSpan=="5" && iTd.item(i).align!="right"){
var iMesSpan=document.createElement('span');
iMesSpan.innerHTML=' - <font size="1" style="cursor: pointer;">(Expand/Collapse)</font>';
iTd.item(i).appendChild(iMesSpan);
iMesSpan.onclick=function(){iCollapse(this);};
(document.cookie.match('iStart'+iTd.item(i).firstChild.name+'=iCollapsed'))? iCollapse(iMesSpan) : '';
}
}
}
function iCollapse(iSpan){
var iCatName=iSpan.parentNode.firstChild.name;
var iCell=iSpan.parentNode.parentNode.nextSibling;
(iCell.style.display=="none")? document.cookie='iStart'+iCatName+'=iCollapsed;expires=Sat, 20 Jan 1990 12:12:12 UTC; path=/;' : document.cookie='iStart'+iCatName+'=iCollapsed;expires=Sat, 20 Jan 2050 12:12:12 UTC; path=/;';
while(iCell.cells[0].className!="catbg"){
(iCell.style.display=="none")? iCell.style.display='' : iCell.style.display='none';
var iCell=iCell.nextSibling;
}
}
//-->
</script>