Hi Ryan,
Try the following. It will show or hide all TRs with class 'collapsible'.
Code:
function offaddress()
{
xGetElementsByClassName('collapsible', document, 'tr',
function(e) {
e.style.display = 'none';
}
);
}
function onaddress()
{
xGetElementsByClassName('collapsible', document, 'tr',
function(e) {
try { e.style.display = 'table-row'; } // DOM
catch (err) { e.style.display = 'block'; } // IE
}
);
}
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
function xGetElementsByClassName(c,p,t,f)
{
var found = new Array();
var re = new RegExp('\\b'+c+'\\b', 'i');
// var list = xGetElementsByTagName(t, p);
var list = p.getElementsByTagName(t);
for (var i = 0; i < list.length; ++i) {
if (list[i].className && list[i].className.search(re) != -1) {
found[found.length] = list[i];
if (f) f(list[i]);
}
}
return found;
}
Bookmarks