Post by Holly on Sept 27, 2009 21:14:24 GMT -5
So! I came onto the site and I absolutely love the tab code you have in use. I found it in your headers / footers and I was wondering if it was a custom code or if it was available for anyone to use? If it is a custom code, I'd like to request to use it on my site ( link ). I would of course, give the creator credit. Oh, and if you're wondering why I'm posting here, it's because it appeared to be the best guest-open board to post it. (:
<script type="text/javascript">
<!--
// Tabulate main page..
if(location.href.match(/\.com\/(index.cgi(\?)?)?(action=home)?$/))
{
//Edit below.....
var tabAmount = 7;
// Edit above.....
var tabCount = 0;
// Find catagories and create tabs..
function tabselect(clicky)
{
for(c=0; c<catCount; c++)
{
document.getElementById('cat'+c).className = 'tab';
}
clicky.className = 'tabselect';
clicky.onmouseout = function(){this.className = 'tabselect';}
var catName = document.getElementsByTagName('a');
for(l=0; l<catName.length; l++)
{
if(catName[l].name.match(/^cat(\d)+$/))
{
catName[l].parentNode.parentNode.style.display = 'none';
}}
catName = document.getElementsByName(clicky.id);
for(l=0; l<catName.length; l++)
{
catName[l].parentNode.parentNode.style.display = '';
}
return;
}
if(typeof(fContent) != 'undefined')
{
fCheck = 'News';
}
else
{
fCheck = 'Forum Name';
}
var tabBoard = new Array();
var td = document.getElementsByTagName('td');
var tabs = document.getElementById('tabtr');
catCount = 0;
for(t=0; t<td.length; t++)
{
// Add tabs..
if(td[t].className.match(/^(news)?titlebg$/) && td[t].innerHTML.match(fCheck))
{
var newTR = document.createElement('tr');
var newTD = document.createElement('td');
newTD.id = 'theTabs';
newTD.colSpan = '5';
newTD.style.padding = '0';
newTR.appendChild(newTD);
td[t].parentNode.parentNode.insertBefore(newTR,td[t].parentNode);
t++;
}
if(td[t].className == 'catbg' && td[t].colSpan == '5' && td[t].align != 'right')
{
td[t].id = 'cat'+catCount;
td[t].align = 'center';
td[t].colSpan = '1';
td[t].style.cursor = 'pointer';
td[t].className = 'tab';
td[t].onclick = function(){tabselect(this);}
td[t].onmouseover = function(){
var mOut = this.className;
this.className = 'tabhovver';
this.onmouseout = function(){this.className = mOut;}}
td[t].parentNode.style.display = 'none';
var boardTR = td[t].parentNode.nextSibling;
tabs.appendChild(td[t]);
tabCount++;
if(tabCount == tabAmount)
{
var newTabTr = document.createElement('TR');
tabs.parentNode.appendChild(newTabTr);
tabs = newTabTr;
tabCount = 0;
}
// Find and tag boards..
while(boardTR.firstChild.className == 'windowbg')
{
boardTR.firstChild.innerHTML += '<a name="cat'+catCount+'"></a>';
if(boardTR == boardTR.parentNode.lastChild)
{
break;
}
boardTR = boardTR.nextSibling;
}
catCount ++;
}}
// Set width of tags..
var setWidth = document.getElementById('tabTable').getElementsByTagName('td');
for(s=0; s<setWidth.length-1; s++)
{
setWidth.width = parseInt(100/setWidth.length)+'%';
}
document.getElementById('theTabs').appendChild(document.getElementById('tabTable'));
tabselect(document.getElementById('cat0'));
}
// -->
</script>
<script type="text/javascript">
<!--
// Tabulate main page..
if(location.href.match(/\.com\/(index.cgi(\?)?)?(action=home)?$/))
{
//Edit below.....
var tabAmount = 7;
// Edit above.....
var tabCount = 0;
// Find catagories and create tabs..
function tabselect(clicky)
{
for(c=0; c<catCount; c++)
{
document.getElementById('cat'+c).className = 'tab';
}
clicky.className = 'tabselect';
clicky.onmouseout = function(){this.className = 'tabselect';}
var catName = document.getElementsByTagName('a');
for(l=0; l<catName.length; l++)
{
if(catName[l].name.match(/^cat(\d)+$/))
{
catName[l].parentNode.parentNode.style.display = 'none';
}}
catName = document.getElementsByName(clicky.id);
for(l=0; l<catName.length; l++)
{
catName[l].parentNode.parentNode.style.display = '';
}
return;
}
if(typeof(fContent) != 'undefined')
{
fCheck = 'News';
}
else
{
fCheck = 'Forum Name';
}
var tabBoard = new Array();
var td = document.getElementsByTagName('td');
var tabs = document.getElementById('tabtr');
catCount = 0;
for(t=0; t<td.length; t++)
{
// Add tabs..
if(td[t].className.match(/^(news)?titlebg$/) && td[t].innerHTML.match(fCheck))
{
var newTR = document.createElement('tr');
var newTD = document.createElement('td');
newTD.id = 'theTabs';
newTD.colSpan = '5';
newTD.style.padding = '0';
newTR.appendChild(newTD);
td[t].parentNode.parentNode.insertBefore(newTR,td[t].parentNode);
t++;
}
if(td[t].className == 'catbg' && td[t].colSpan == '5' && td[t].align != 'right')
{
td[t].id = 'cat'+catCount;
td[t].align = 'center';
td[t].colSpan = '1';
td[t].style.cursor = 'pointer';
td[t].className = 'tab';
td[t].onclick = function(){tabselect(this);}
td[t].onmouseover = function(){
var mOut = this.className;
this.className = 'tabhovver';
this.onmouseout = function(){this.className = mOut;}}
td[t].parentNode.style.display = 'none';
var boardTR = td[t].parentNode.nextSibling;
tabs.appendChild(td[t]);
tabCount++;
if(tabCount == tabAmount)
{
var newTabTr = document.createElement('TR');
tabs.parentNode.appendChild(newTabTr);
tabs = newTabTr;
tabCount = 0;
}
// Find and tag boards..
while(boardTR.firstChild.className == 'windowbg')
{
boardTR.firstChild.innerHTML += '<a name="cat'+catCount+'"></a>';
if(boardTR == boardTR.parentNode.lastChild)
{
break;
}
boardTR = boardTR.nextSibling;
}
catCount ++;
}}
// Set width of tags..
var setWidth = document.getElementById('tabTable').getElementsByTagName('td');
for(s=0; s<setWidth.length-1; s++)
{
setWidth
}
document.getElementById('theTabs').appendChild(document.getElementById('tabTable'));
tabselect(document.getElementById('cat0'));
}
// -->
</script>