posted 20 years ago
Created an expandable menu which works fine in IE, but not in NS. I've tested and it's not the onclick funtion. Can you make any suggestions as to the problem?
Code on menu page --
on[do]Click='javascript:expand(this);return true;
Code for expand function --
function parseId(id, part)
{
var p1, p2;
p1 = 0;
p2 = id.indexOf("_");
if (part == 1)
return id.substring(p1, p2);
p1 = ++p2;
p2 = id.indexOf("_", p1);
if (part == 2)
return id.substring(p1, p2);
p1 = ++p2;
p2 = id.length;
return id.substring(p1, p2)
//return true; doesn't work here to enable the dropdown to show
}
function expand(parent)
{
//alert ('You are now leaving my site')
var id, par, me, lvl;
var id, cpar, cme, clvl;
var i;
// check level and see if the menu is expanded then
par = parseId(parent.id, 1);
me = parseId(parent.id, 2);
lvl = parseId(parent.id, 3);
for (i = 0; i< Table1.rows.length; i++)
{
tr = Table1.rows.item(i);
cpar = parseId(tr.id, 1);
cme = parseId(tr.id, 2);
clvl = parseId(tr.id, 3);
if (clvl > lvl)
tr.style.display="none";
if (cpar == me)
tr.style.display="inline";
//return true; doesn't work here to enable the dropdown to show
}
//return true; doesn't work here to enable the dropdown to show
}
// -->