Forum Category as Tab Help
2 posters
Page 1 of 1
Forum Category as Tab Help
I have added a code for forum category as tab
JS
CSS
Demo: http://ashik4u.forums.com.bz/
Question: Is it possible to make the first category set default to show after entering my site? I meant a category will set for show because this script only working for clicking on the tabs. Without clicking a tab, none of the categories showed up.
JS
- Code:
function tttf(n) {
var tables = document.getElementById("main-content").getElementsByTagName("table")[n].parentNode;
document.getElementById("ttid").innerHTML = tables.innerHTML;
}
$(function() {
if (location.pathname=="/forum" || location.pathname=="/") {
var tables = document.getElementById("main-content").getElementsByTagName("table");
var tf = document.getElementById("main-content");
var ttab = document.createElement("ul");
ttab.setAttribute("id","ttcl");
for (i=0; i<tables.length; i++) {
tables[i].parentNode.style.display="none";
tables[i].parentNode.previousSibling.style.display="none";
ttab.innerHTML += "<li><a href='javascript:void(0);' onclick='tttf(" + [i] + ")'>" + tables[i].parentNode.previousSibling.childNodes[0].childNodes[0].innerHTML + "</a></li>";
tf.parentNode.insertBefore(ttab,tf);
}
var tl = document.createElement("div");
tl.innerHTML = "<div id='ttid'>Click on the above tabs to choose a category!</div>";
tf.parentNode.insertBefore(tl,tf);
}
});
CSS
- Code:
#ttcl {
display: block;
list-style-type: none;
margin: 10px 0px 10px 0px;
}
#ttcl li {
display: inline;
padding: 5px;
margin: 0px 0px 0px 5px;
background: #FFFFFF;
border-radius: 5px;
border: 1px solid #000000;
}
#ttid {
display: block;
background: #FFFFFF;
border-radius: 5px;
border: 1px solid #000000;
padding: 5px;
margin: 5px;
}
Demo: http://ashik4u.forums.com.bz/
Question: Is it possible to make the first category set default to show after entering my site? I meant a category will set for show because this script only working for clicking on the tabs. Without clicking a tab, none of the categories showed up.
Re: Forum Category as Tab Help
Please don't double/triple post. Your post need to be separated by 24 hours before bumping, replying or adding more information. Please use the edit button instead!
Since this is your third reminder, you have received a warning.
Since this is your third reminder, you have received a warning.
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Similar topics
» How can i change my forum's category??F.e. move it to category :Computers and science??
» How to have the category of Announcements that it contain the topic. And It will show every page/forum like the category ...
» Category Showing as "Forum" instead of the category name.
» How to settle a category of my forum (for the forum listing)
» Table position in category, and how to hide category border and name, and reduce size of category to my table
» How to have the category of Announcements that it contain the topic. And It will show every page/forum like the category ...
» Category Showing as "Forum" instead of the category name.
» How to settle a category of my forum (for the forum listing)
» Table position in category, and how to hide category border and name, and reduce size of category to my table
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum