|
 7.2 Кб |
|
| Здравствуйте. помогите пожалуйста разобраться с ошибкой в коде древовидного меню.
Есть такая функция:
function drawOutline(ol, prefix)
{
var output = "";
var nestCount, link, nestPrefix, lastInnerNode;
prefix = (prefix) ? prefix : "";
for (var i = 0; i < ol.childNodes.length; i++)
{
nestCount = (ol.childNodes[i].childNodes) ? ol.childNodes[i].childNodes.length : 0;
output += "<div class='OLRow' id='line" + currID++ + "'>\n";
if (nestCount > 0)
{
output += prefix;
output += "<img id='widget" + (currID-1) + "' src='" + ((i == ol.childNodes.length-1 && blockID != 0) ? collapsedWidgetEnd.src : (blockID == 0) ? collapsedWidgetStart.src : collapsedWidget.src);
output += "' height=" + widgetHeight + " width=" + widgetWidth;
output += " title='Click to expand/collapse nested items.'" + "onClick='toggle(this." + blockID + ")'> ";
link = (ol.childNodes[i].item.uri) ? ol.childNodes[i].item.uri: "";
if (link)
{
output += "<a href='" + link + "' class='itemTitle' title='" + link + "' target='" + displayTarget + "'>" ;
}
else
{
output += "<a class='itemTitle' title='" + link + "'>";
}
output += "<span style='position:relative;top:-3рх: height:llpx'>" + ol.childNodes[i].item.text + "</span></a>";
currState += calcBlockState(currID-1);
output += "<span class='OLBlock' blocknum='" + blockID + "'" + "id='OLBlock" + blockID++ + "'>";
nestPrefix = prefix;
nestPrefix += (i == ol.childNodes.length - 1) ? "<img src='" + emptySpace.src + "' height=" + widgetHeight + " width=" + widgetWidth + ">" : "<img src='" + chainSpace.src + "' height=" + widgetHeight + " width=" + widgetWidth + ">";
output += drawOutline(ol.childNodes[i]. nestPrefix);
output += "</span></div>\n";
}
else
{
output += prefix;
output += "<img id='widget" + (currID-l) + "' src='" + ((i == ol.childNodes.length - 1) ? nodeWidgetEnd.src : nodeWidget.src);
output += "' height=" + widgetHeight + " width=" + widgetWidth + ">";
link = (ol.childNodes[i].item.uri) ? ol.childNodes[i].item.uri : "";
if (link)
{
output += " <a href='"+link+"' class='itemTitle' title='" + link + '" target="' + displayTarget + "'>";
}
else
{
output += " :<a class='itemTit1e' title='" + link + "'>";
}
output += "<span style='position:relative: top:-3px;height:llpx'>" + ol.childNodes[i].item.text + "</span></a>";
output += "</div>\n";
}
}
return output;
}
|
В аргументах ф-ции есть переменная ol, которую в коде нигде больше как здесь не использую.
Ошибку выдают мне следующую: переменная ol не имеет никаких свойств.
На всякий случай прикрепляю весь файл. | |
|
|