Nu sunteti conectat. Conectati-va sau inregistrati-va

Mesaj [Pagina 1 din 1]

1 Categorii in tabel la data de Lun Oct 22, 2012 11:38 am

Wanse
avatar

Administrator
Administrator
Categorii in tabel


Demo:

Si



Buna ziua, va voi arata un script pentru a va pune categoriile intr-un tabel!
Acest tabel are un cod in parte pentru fiecare versiune, sper sa va placa :Uimit:

Pentru Invision:
Cod:
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 = $(".index-box").get();
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";
ttab.innerHTML += "<li><a href='javascript:void(0);' onclick='tttf(" + [i] + ")'>" + tables[i].previousSibling.childNodes[0].innerHTML + "</a></li>";
tf.parentNode.insertBefore(ttab,tf);
}
var tl = document.createElement("div");
tl.innerHTML = "<div id='ttid'>Click mai sus pentru a deschide categoriile</div>";
tf.parentNode.insertBefore(tl,tf);
}
});


Phpbb2:
Cod:
function tttf(n) {
var tables = $("#page-body table.forumline")[n];
document.getElementById("ttid").innerHTML = "<table class='forumline' width='100%' cellspacing='1' cellpadding='0' border='0'>" + tables.innerHTML + "</table>";
}
$(function() {
if (location.pathname=="/forum" || location.pathname=="/") {
var tables = $("#page-body table.forumline").get();
var tf = document.getElementById("page-body");
var ttab = document.createElement("ul");
ttab.setAttribute("id","ttcl");
for (i=0; i<tables.length; i++) {
if (i==tables.length-1) {
break;
}
tables[i].style.display="none";
ttab.innerHTML += "<li><a href='javascript:void(0);' onclick='tttf(" + [i] + ")'>" + document.getElementById('page-body').getElementsByTagName('h2')[i].innerHTML + "</a></li>";
tf.parentNode.insertBefore(ttab,tf);
}
var tl = document.createElement("div");
tl.innerHTML = "<div id='ttid'>Click mai sus pentru a deschide categoriile</div>";
tf.parentNode.insertBefore(tl,tf);
}
});

Phpbb3:
Cod:
function tttf(n) {
var tables = $("#main-content .forabg")[n];
document.getElementById("ttid").innerHTML = "<div class='forabg'>" + tables.innerHTML + "</div>";
}
$(function() {
if (location.pathname=="/forum" || location.pathname=="/") {
var tables = $(".forabg").get();
var tf = document.getElementById("main-content");
var ttab = document.createElement("ul");
ttab.setAttribute("id","ttcl");
for (i=0; i<tables.length; i++) {
tables[i].style.display="none";
ttab.innerHTML += "<li><a href='javascript:void(0);' onclick='tttf(" + [i] + ")'>" + tables[i].childNodes[0].childNodes[1].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].innerHTML + "</a></li>";
tf.parentNode.insertBefore(ttab,tf);
}
var tl = document.createElement("div");
tl.innerHTML = "<div id='ttid'>Click mai sus pentru a deschide categoriile</div>";
tf.parentNode.insertBefore(tl,tf);
}
});

PunBB:
Cod:
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 mai sus pentru a deschide categoriile</div>";
tf.parentNode.insertBefore(tl,tf);
}
});

Si in CSS:
Cod:
#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;
}


Numai bine,
Echipa RealSupport

http://realsupport.lforum.biz

Permisiunile acestui forum:
Nu puteti raspunde la subiectele acestui forum

 
  • Forumgratuit.ro | © PunBB | Forum gratuit de suport | Contact | Semnaleaza un abuz | Creeaza un blog