Back to vBulletin 3.6 Add-ons

Load category by click
Mod Version: 1.00, by Lee Saker

This modification is in the archives.
vB Version: 3.6.8 Rating: (1 vote - 5.00 average) Installs: 10
Released: 09 Oct 2007 Last Update: Never Downloads: 174
Not Supported Template Edits Is in Beta Stage  

Simple demo: attachment

Install:
Add to bottom of template headinclude
<script language="JavaScript1.3">
var panes = new Array();

function setupPanes(containerId, defaultTabId) {
// go through the DOM, find each tab-container
// set up the panes array with named panes
// find the max height, set tab-panes to that height
panes[containerId] = new Array();
var maxHeight = 0; var maxWidth = 0;
var container = document.getElementById(containerId);
var paneContainer = container.getElementsByTagName("div")[0];
var paneList = paneContainer.childNodes;
for (var i=0; i < paneList.length; i++ ) {
var pane = paneList[i];
if (pane.nodeType != 1) continue;
if (pane.offsetHeight > maxHeight) maxHeight = pane.offsetHeight;
if (pane.offsetWidth > maxWidth ) maxWidth = pane.offsetWidth;
panes[containerId][pane.id] = pane;
pane.style.display = "none";
}
paneContainer.style.height = maxHeight + "px";
paneContainer.style.width = maxWidth + "px";
document.getElementById(defaultTabId).onclick();
}

function showPane(paneId, activeTab) {
// make tab active class
// hide other panes (siblings)
// make pane visible

for (var con in panes) {
activeTab.blur();
activeTab.className = "tab-active";
if (panes[con][paneId] != null) { // tab and pane are members of this container
var pane = document.getElementById(paneId);
pane.style.display = "block";
var container = document.getElementById(con);
var tabs = container.getElementsByTagName("ul")[0];
var tabList = tabs.getElementsByTagName("a")
for (var i=0; i<tabList.length; i++ ) {
var tab = tabList[i];
if (tab != activeTab) tab.className = "tab-disabled";
}
for (var i in panes[con]) {
var pane = panes[con][i];
if (pane == undefined) continue;
if (pane.id == paneId) continue;
pane.style.display = "none"
}
}
}
return false;
}
</script>
Open template forumhome and search
<body>
Replace with
<body onload='setupPanes("containerx", "tabx");'>
x is no of category you want it is default
Search
<!-- main -->
$forumbits
<!-- /main -->
Replace with
<div id="containerx">
<ul class="tabs">
<li><a href="#" onClick="return showPane('x', this)" id="tabx">x</a></li>
<li><a href="#" onClick="return showPane('y', this)">y</a></li>
</ul>

<div class="tab-panes">

<!-- main -->
$forumbits
<!-- /main -->

</div>
</div>
y is no of yours categories
Search template forumhome_forumbit_level1_nopost, add on top
<div id="$forumid">
Add on bottom
</div>
Finish

Click Install if you like it

Download

This modification is archived, downloads are still allowed.

File Type: %1$s Demo.zip (1.7 KB, 181 downloads)

Supporters / CoAuthors

  • Lee

Similar Mods

Board Optimization Deny Unregistered Users When Load Is High - Load Deny (*Nix) vBulletin 3.6 Add-ons

vblts.ru supports vBulletin®, 2022-2025