meth
04-11-2006, 07:34 PM
I'm looking for a dhtml guru to help me find Waldo in IE. Waldo can be seen on this page (http://202.60.81.120/~sthcpec/template_02.php). When you mouseover the product and recipe link, the css menu works.
However Waldo disappears when the menu is dynamically populated (http://bauer.jumba.net.au/~sthcpec/). Me thinks the structure of the nested list scares Waldo away.
Both pages use the same CSS and same JS function to operate the menus but the dynamic menu doesn't work in IE.
The JS function is:
activateMenu = function(nav) {
var avtivated = 0;
var totLIUL = 0;
var overApplied = 0;
var outApplied = 0;
/* currentStyle restricts the Javascript to IE only */
if (document.all && document.getElementById(nav).currentStyle) {
var navroot = document.getElementById(nav);
var activated = 1;
/* Get all the list items within the menu */
var lis=navroot.getElementsByTagName("LI");
for (i=0; i<lis.length; i++) {
/* If the LI has another menu level */
if(lis[i].lastChild.tagName=="UL"){
totLIUL++;
/* assign the function to the LI */
lis[i].onmouseover = function() {
/* display the inner menu */
this.lastChild.style.display="block";
this.lastChild.style.sIndex="100";
overApplied++;
}//mouseover
lis[i].onmouseout=function() {
this.lastChild.style.display="none";
outApplied++;
}// mouse out
}// if li has nested ul
}// for loop
//debugging
if(activated == 1){
alert ('Nav Activated :: ' +'Nested UL\'s Found = ' + totLIUL + ' :: ' + 'Fn mouseover applied = ' + overApplied + ' :: Fn mouseout applied = ' + outApplied);
}
}// if ie
}// activate function
This is the debug version. The alert message says the function runs OK, it finds all the nested UL's OK, but it can't apply the mouse event functions with "this.lastChild.style.display".
Where's Waldo?
However Waldo disappears when the menu is dynamically populated (http://bauer.jumba.net.au/~sthcpec/). Me thinks the structure of the nested list scares Waldo away.
Both pages use the same CSS and same JS function to operate the menus but the dynamic menu doesn't work in IE.
The JS function is:
activateMenu = function(nav) {
var avtivated = 0;
var totLIUL = 0;
var overApplied = 0;
var outApplied = 0;
/* currentStyle restricts the Javascript to IE only */
if (document.all && document.getElementById(nav).currentStyle) {
var navroot = document.getElementById(nav);
var activated = 1;
/* Get all the list items within the menu */
var lis=navroot.getElementsByTagName("LI");
for (i=0; i<lis.length; i++) {
/* If the LI has another menu level */
if(lis[i].lastChild.tagName=="UL"){
totLIUL++;
/* assign the function to the LI */
lis[i].onmouseover = function() {
/* display the inner menu */
this.lastChild.style.display="block";
this.lastChild.style.sIndex="100";
overApplied++;
}//mouseover
lis[i].onmouseout=function() {
this.lastChild.style.display="none";
outApplied++;
}// mouse out
}// if li has nested ul
}// for loop
//debugging
if(activated == 1){
alert ('Nav Activated :: ' +'Nested UL\'s Found = ' + totLIUL + ' :: ' + 'Fn mouseover applied = ' + overApplied + ' :: Fn mouseout applied = ' + outApplied);
}
}// if ie
}// activate function
This is the debug version. The alert message says the function runs OK, it finds all the nested UL's OK, but it can't apply the mouse event functions with "this.lastChild.style.display".
Where's Waldo?