Welcome Guest [Log In] [Register]
Search Members Calendar | Rules ZB Code Index IF Code Index
ZBCode
  • Navigation
  • ZBCode
  • Coding Resources
  • Zetaboards Modifications
  • limit subforum list by expand/collapse
Hey, welcome to ZBCode, the premier coding forum for ZB. Here you fill find some of the best Invisionfree and Zetaboards Codes on the network! Unfortunately, you're sorta hovering around in guest mode at the moment; why not join in on the fun? Register an account and you can start accessing the wealth of resources we have available here. Enjoy your stay at ZBCode, and remember to tell all your friends about us; the more members, the more codes available. ;)

Interested in joining? Click here.


If you are already a member of ZBCode, feel free to login right here:

Username:   Password:
Locked Topic
limit subforum list by expand/collapse
Tweet Topic Started: Aug 11 2008, 06:33 PM (551 Views)
Godkillah Aug 11 2008, 06:33 PM Post #1


Posts:
55
Group:
Member
Member
#20
Joined:
Jul 13, 2008
this code shortens the subforum lists when the number of subforums is bigger than the X value
when a list is shortened it gets collapsed, once the user presses the expand link the list will restore and contain a collapse link to undo the effect

add to footers
Code:
 
<script>
/*limit subforum list by expand/collapse
by Godkillah from zbcode.com & phantom-designs.net*/
x=5;

function collapse(fish){
document.getElementById('2-'+fish).style.display='block';
document.getElementById('1-'+fish).style.display='none';
}
function expand(fish){
document.getElementById('1-'+fish).style.display='block';
document.getElementById('2-'+fish).style.display='none';
}
pornAtPpd=0;
a=document.getElementsByTagName("td");
for(i=0;i<a.length;i++){
if(a[i].className=='c_subforum' && a[i].getElementsByTagName("a").length>x){
pornAtPpd++;
a[i].innerHTML='<span style="display:none;" id="1-'+pornAtPpd+'">'+a[i].innerHTML+' <b><a href="javascript:collapse('+pornAtPpd+')">[collapse]</a></b></span><span id="2-'+pornAtPpd+'"><strong>Subforums:</strong> <b><a href="javascript:expand('+pornAtPpd+')">[expand]</a></b></span>';
}}
</script>


rate&comment
enjoy
Edited by Reid, Jun 15 2009, 08:27 PM.
http://www.pdforums.net
For good and fast support on all your coding, graphics or skinning needs!
Offline Profile Goto Top
 
PIWYRCOM Aug 12 2008, 12:32 AM Post #2
Member Avatar
PrideInWhatYouRide

Posts:
368
Group:
Member
Member
#53
Joined:
Jul 17, 2008
Coding language
None
Two thumbs UP !!

We set ours to 0 , it really 'cleans up' the index page.
» TEST FORUM »
FIND IT HERE !
Spoiler: click to toggle

→ Infinite Results (themes)
→ ZBThemeZone (themes)

→ Big Boards (codes/themes)
→ ZBCodes (codes/themes)
→ The Coding Zone (codes/themes)

→ Code Index ('Official')
→ ZetaDoc's ('Official - How To Info')

Posted Image

Offline Profile Goto Top
 
Godkillah Aug 12 2008, 12:15 PM Post #3


Posts:
55
Group:
Member
Member
#20
Joined:
Jul 13, 2008
I´m glad to hear you like it :)
thanks for the comment
http://www.pdforums.net
For good and fast support on all your coding, graphics or skinning needs!
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Zetaboards Modifications · Next Topic »
Locked Topic

Track Topic · E-mail Topic Time: 9:36 AM Jul 11
Hosted for free by ZetaBoards · Privacy Policy