[QUOTE]
var ie=document.all && window.showModalDialog && navigator.appName==”Microsoft Internet Explorer”;
if (document.getElementsByTagName) {
var f = document.getElementsByTagName(“LI”);
for (i=0; i<f.length; i++) {
if (f[i].className == “sublevel”){
var [B]toggle[i].childNodes[1]:f[i].nextSibling.nextSibling;
f[i].onmouseover=function() {
[COLOR=DarkOrange]toggle.style.display=’block’;[/COLOR]
[COLOR=Sienna] alert(toggle.nodeName);
alert(toggle.style.display);
// this works for IE: [B]this.childNodes[1].style.display=’block’;
// this works for FF/Op: [B]this.nextSibling.nextSibling.style.display=’block’;
// but why wont the above work??
};
f[i].onmouseout=function() {
[COLOR=DarkOrange]toggle.style.display=’none’;[/COLOR]
};
.
.
.
Im in the middle of building a unique dropdown menu but have come accross some weird variable problem. To overcome the different normalized DOM versions between IE and FF/Opera I introduce a variable called ie. This is used to assign the next element (in my case a <UL> element) to the [B]toggle
[COLOR=DarkOrange]toggle.style.display=’block’;
but, I know it is holding the correct reference and is able to execute as the following actions work:
[COLOR=Sienna] alert(toggle.nodeName);
alert(toggle.style.display);
why is this? and how do I overcome it?
Thanks in advance for any help.