> I don't think there is much we can do about the offset from the top
when there are line wraps.
Javascript can adjust the marginTop's for the submenus that wrap two
lines. For some reason, my level3 menus require more correction.
If an item has more than 2 child nodes, it contains a submenu.
If the submenu class is 'level2' & if (based on my width setting) the
main item's inner HTML has more than 18 chars, the submenu needs a small
adjustment to marginTop.
If the submenu class is 'level3' & if the sub item's inner HTML has more
than 26 chars, the submenu needs a greater adjustment to marginTop.
if (li_item[i].childNodes.length > 2) {
if ((li_item[i].childNodes(0).innerHTML.length > 18) &&
(li_item[i].childNodes(2).className == "level2")) {
li_item[i].childNodes(2).style.marginTop = '-2.5em';
}
if ((li_item[i].childNodes(0).innerHTML.length > 26) &&
(li_item[i].childNodes(2).className == "level3")) {
li_item[i].childNodes(2).style.marginTop = '-3.1em';
}
}
Since the menu CSS never refers to the classes output by
simpleNavigation, it would be nice to not have to refer to them in the
script either, but its simpiler. I didn't feel like spending more hours
trying to figure out how to target those nodes the hard way.
The above doesn't work for Mozilla though, so I'm looking into that now.
I think for Mozilla, I'll need to make references to the classes output
by simpleNavigation because 'childNodes' acts totally different. I
believe W3C has depricated 'innerHTML', so I'm not sure how to get the
char length within the items right now. I've never scripted something
for Mozilla's DOM, but I hope the same sort of adjustments can be done.
I'd like a cross-browser script, but suspect I'll need to do a DOM check
and branch to different adjustment scripts.
----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/magnolia/developer.html
----------------------------------------------------------------