PDA

View Full Version : Treelist bug



SteeleR
01-24-2008, 12:44 PM
http://89.215.52.231/templates/43/
http://89.215.52.231/templates/43/tree.js

this is the 'tree' and apparently, when clicking on a submenu i get a click on the parent menu too... I've tried the following:


function openFolder(e)
{
if (list[e] != 1)
{
e.parentNode.getElementsByTagName('ul')[0].style.display = 'none';
e.style.backgroundImage = 'url(images/minus.gif)';
list[e] = 1;
e.childNodes.getElementsByTagName('ul')[0].style.display = 'block';
}
else
{
e.parentNode.getElementsByTagName('ul')[0].style.display = 'block';
e.style.backgroundImage = 'url(images/plus.gif)';
list[e] = 0;
e.childNodes.getElementsByTagName('ul')[0].style.display = 'none';
}
}

but this turned out to be more buggy cause there is no childNodes function and such.. and some of the <li>'s don't have submenus so... more and more bugs..

any idea how to get it multilevel ?

Thanks beforehand