Hi
I've created a drop-down menu for a site I'm working on, the menu is built using nested <ul> elements, and uses javascript to control it. (collapse / expand when a menu item is clicked).
It works fine in Firefox and IE, but I'm having trouble getting the javascript to work in Safari.
I think its breaking on this bit of code
for(var i in nav.childNodes){
if(nav.childNodes.nodeType == 1 && nav.childNodes.nodeName.toLowerCase() =='ul'){
theItem = nav.childNodes;
// code removed
}
}
When I alert nav.childNodes.nodeType it comes out as undefined, so not sure if Safari handles childNodes in a different way.
Any ideas? Cheers, Andy
I've created a drop-down menu for a site I'm working on, the menu is built using nested <ul> elements, and uses javascript to control it. (collapse / expand when a menu item is clicked).
It works fine in Firefox and IE, but I'm having trouble getting the javascript to work in Safari.
I think its breaking on this bit of code
for(var i in nav.childNodes){
if(nav.childNodes.nodeType == 1 && nav.childNodes.nodeName.toLowerCase() =='ul'){
theItem = nav.childNodes;
// code removed
}
}
When I alert nav.childNodes.nodeType it comes out as undefined, so not sure if Safari handles childNodes in a different way.
Any ideas? Cheers, Andy