Użytkownik:Botyzjusz I/monobook.js: Różnice pomiędzy wersjami

Z Nonsensopedii, polskiej encyklopedii humoru
Linia 6: Linia 6:
{
{
if(h2[i].parentNode.getAttribute("id") == "toctitle") continue;
if(h2[i].parentNode.getAttribute("id") == "toctitle") continue;
ul = h2[i].nextSibling.nextSibling; alert(ul)
ul = h2[i].nextSibling;
ul.style.backgroundColor="red"; //alert();
if(ul.nodeName == "#text") ul = ul.nextSibling;
ul.style.backgroundColor="red";
}
}
});
});

Wersja z 17:25, 8 lut 2012

addOnloadHook(function(){
    if(wgPageName != "Nonsensopedia:Ankiety/propozycje") return;
    var content = document.getElementById("bodyContent");
    var h2 = content.getElementsByTagName("h2");
    for(i in h2)
    {
        if(h2[i].parentNode.getAttribute("id") == "toctitle") continue;
        ul = h2[i].nextSibling;
        if(ul.nodeName == "#text") ul = ul.nextSibling; 
        ul.style.backgroundColor="red"; 
    }
});