Board Logo

 Username:    Password:    Stay logged in: Welcome Guest. Please Login or Register.  Feb 18th, 2018, 03:07am

Coding Forum
Important News
Remember to add where the code goes in the headers/footers.

Also, please check the list of codes on the Hacks board, especially if you have an error. The code may already have been corrected.
Welcome to the Conforums Hacks Board!

Please follow these simple rules.

1. No spamming.
2. Do not advertise your board in here!
3. Keep on topic, or the thread will be locked.
4. No flame wars.
5. No bringing up old topics.

Please note: For codes other than those submitted in the Hacks Forum, please ask for permission to use from the creator. Be aware that coding queries in the Coding Forum become public domain. If you still seek coding help but find it inconvenient to display it publicly then please PM one of the moderators. We encourage all queries to be submitted here in hopes to help other members who might have the same question. Thank you.

Helpful sites
Dynamic Drive

The Staff

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Tabbed Catagories?  (Read 1267 times)

member is offline



Posts: 2
xx Tabbed Catagories?
« Thread started on: Nov 4th, 2013, 5:52pm »

I would like to have a code that files all the Categories of my board in a tab bar at the top of my forum. The default page would be the general information page, but it would only show that one category.

What I am getting at is I need a tabbed category bar so that we can have multiple categories and boards without having it clutter the page by filing one after another on the main page, thus making it very long so you have to scroll all the way down.

Clicking a category title on the bar would bring you to that category's page and it's boards, but you would see no other category.

Do you get what I'm saying? I wish I had a board example to show you, but I have forgotten them.
User IP Logged

Ex-Shiny Gold Star Club Member
Conforums Administrator

member is offline


Homepage PM

Gender: Male
Posts: 1777
xx Re: Tabbed Catagories?
« Reply #1 on: Nov 5th, 2013, 03:35am »

While note exactly what youre looking for I am at the airport about to go on vacation, this allows your users to collapse categories and expand them by clicking the cell itself.

Main footers.
// Hide/Show Categories with Remembering v2 by CD
// Do not redistribute without permission of the creator

var hidden = ""; // Shown when hidden
var shown = ""; // Shown when visible

// Do not edit below here
// Vars
var aTD = document.getElementsByTagName("TD");

// Preload
document.write("<img src='"+hidden+"' border='0' style='display: none;' /><img src='"+shown+"' border='0' style='display: none;' />");

// Cookie stuff
function getCookieVal(offset) {
    var endstr = document.cookie.indexOf(";",offset);
    endstr = (endstr==-1?document.cookie.length:endstr);
    return document.cookie.substring(offset,endstr);
function GetCookie(name) {
    var arg = name+"=";
    var alen = arg.length;
    var clen = document.cookie.length;
    var i = 0;
    var data_2 = "";
    while(i < clen) {
        var j = i + alen;
        if(document.cookie.substring(i,j) == arg)
            data_2 += getCookieVal (j);
        i = document.cookie.indexOf(" ",i) + 1;
    return data_2;
function SetCookie(name,value){
    expires = new Date();
    document.cookie = name+"="+value+"; expires="+expires.toGMTString().replace(/\d{4}/i,"2050");

// Code
if((GetCookie("hideShow")) && (location.href.match(/action=home$/i) || !location.href.match(/action=|board=/i))){
    var cook = GetCookie("hideShow");
        if(aTD[a].className == "catbg" && aTD[a].getElementsByTagName("A")[0] && aTD[a].getElementsByTagName("A")[0].name){
            var image = new Image();
   = "none";

            if(cook.match(new RegExp("\\s"+aTD[a].getElementsByTagName("A")[0].name,"i"))){
                image.src = hidden;
                    if(aTD[b].width == "66%")
                        aTD[b] = "none";
                    else if(!aTD[b].className.match(/windowbg/i)){
                        extol = true;
            } else {
                image.src = shown;
                extol = false;
            image.onclick = function(){ hideShow(this); };
            aTD[a].onclick = function(){ hideShow(this.firstChild); };
            a = (extol?b-2:a);
} else if(!(GetCookie("hideShow"))){

function hideShow(ext){
    newStatus = (ext.src==hidden?"":"none");
    if(ext.src == hidden)
        SetCookie("hideShow",GetCookie("hideShow").replace(new RegExp("\\s"+ext.parentNode.getElementsByTagName("A")[0].name,"i")));
        SetCookie("hideShow",GetCookie("hideShow")+" "+ext.parentNode.getElementsByTagName("A")[0].name+" ");

        if(aTD[a].innerHTML == ext.parentNode.innerHTML){
                if(aTD[b].width == "66%")
                    aTD[b] = newStatus;
                else if(!aTD[b].className.match(/windowbg/i))
    ext.src = (ext.src == hidden?shown:hidden);


This will allow your users to collapse any categories they arent using and it creates a cookie to remember it.
« Last Edit: Nov 5th, 2013, 03:37am by Dalton » User IP Logged

User Image

member is offline



Posts: 2
xx Re: Tabbed Catagories?
« Reply #2 on: Nov 5th, 2013, 5:45pm »

I think this might work! Thanks, I'm going to try it out now :>

-- If you ever do find that code I'm looking for though, please tell me. Much appreciated!
« Last Edit: Nov 5th, 2013, 5:50pm by Mai » User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Back To Top
Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls