1º Passo - Inserindo o script
Vamos adicionar um código #JavaScript para dar funcionalidade ao código.
- Código:
$(function () {
var selector = "div#left table.forumline, div#left div.module, div#right table.forumline, div#right div.module";
/* Tutorial = http://staffergroupbr.stuning.net/t2272- */
$(selector).has("[class^='modulo_foro']")
.hide();
$("[class^='modulo_foro']").each(function () {
var arr = $(this).attr("class").match(/[fc]\d+|[\*i]/gi);
for (f in arr) {
if (arr[f] == "*" || (arr[f].toUpperCase() == "I" && fa_soyindice_()) || fa_estoyEnCategoriaOForo_(arr[f])) {
$(this).closest(selector)
.show();
}
}
});
});
function fa_soyindice_() {
return $("#i_icon_mini_index").parent().attr("href") == $(location).attr('pathname');
}
function fa_estoyEnCategoriaOForo_(catOrForum) {
var estrictMode = "";
var c_o_f = "f";
if (catOrForum.match(/^c/i)) c_o_f = "c";
if (catOrForum.match(/^[FC]/)) estrictMode = ":last";
var re = new RegExp("^\/" + c_o_f + "\\d+", 'g');
var found = false;
$("a[href^='/" + c_o_f + "']" + estrictMode + ".nav").each(function () {
href = $(this).attr("href");
if (href.match(re)) {
if ("/" + catOrForum.toLowerCase() == href.match(re)[0]) {
found = true;
}
}
if (found) return false;
});
return found;
}
2º Passo - Escolhendo o widget
Agora vamos até o widget que queremos ocultar, e preencher da forma certa.
No campo Título do widget : você irá colocar o seguinte código;
- Código:
<span class="modulo_foro[I,f2,c3]">Título do widget</span>
Exemplos;
Use como quiseres.[I]
[I,f2]
[I,f2,c3]
[I,f2,c3,f40,c10]
[I,f2,c3,c11,f200,f8]
Com relação ao resultado, acho que não há imagens para explicar, o widget simplesmente ficará invisível no local determinado.
PRECISA DE SUPORTE?
Criador: Turbodeif / D'Leandro™ Site: http://staffergroupbr.stuning.net/t2272-ocultar-widgets-em-áreas-específicas |