52.403
Bearbeitungen
(Die Seite wurde neu angelegt: →Jedes JavaScript hier wird für alle Benutzer für jede Seite geladen.: →Any JavaScript here will be loaded for all users on every page load.: // <syntax typ...) |
Keine Bearbeitungszusammenfassung |
||
Zeile 1:
/**
Toggles the display of elements on a page
Author/contact: Austin Che http://openwetware.org/wiki/User:
*/
Zeile 85 ⟶ 79:
var togglerElems = new Array();
var toggleGroup = new Array();
togglers = new Array(); ▼
// make list of all document classes
Zeile 163 ⟶ 153:
addOnloadHook(toggleInit);
function unToggle()
// </syntax>▼
{
var path=window.location.href;
var parts=path.split("#");
if(parts.length > 1)
{
path=parts[parts.length-1];
parts=path.split(".23");
var untogglerClass = new Array();
// make list of all document classes
var elems = document.getElementsByTagName("*");
var numelems = elems.length;
for (var c=0; c < parts.length; c++)
{
for (var i = 0; i < elems.length; i++)
{
var elem = elems[i];
if (!elem.className)
continue;
var elemClasses = elem.className.split(' '); // get list of classes
for (var j = 0; j < elemClasses.length; j++)
{
var elemClass=elemClasses[j];
if (elemClass != parts[c])
continue;
else
{
untogglerGroup.push(elem);
untogglerClass.push(elemClass);
}
}
}
}
// add javascript links to all toggler elements
for (var i = 0; i < untogglerGroup.length; i++)
{
untogglerGroup[i].style.display = '';
}
}
}
addOnloadHook(unToggle);
|