News:

Wondering if this will always be free?  See why free is better.

Main Menu

Javascript error "object required"

Started by babylonking, May 20, 2005, 02:10:30 PM

Previous topic - Next topic

babylonking

Hi Guys

I'm having problem with the javascript code below, The script it's working fine but i keep getting error message on IE Status Bar.

To test it click on Members Tools block  http://www.babylonking.net/forum/

The 2 codes below causing that error

activateMenu(\'nav\');
activateMenu(\'vertnav\');


Here is the full code
<script language="javascript" type="text/javascript">
activateMenu = function(nav) {

    /* currentStyle restricts the Javascript to IE only */
if (document.all && document.getElementById(nav).currentStyle) { 
        var navroot = document.getElementById(nav);
       
        /* 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"){
           
                /* assign the function to the LI */
              lis[i].onmouseover=function() {
               
                   /* display the inner menu */
                   this.lastChild.style.display="block";
                }
                lis[i].onmouseout=function() {                       
                   this.lastChild.style.display="none";
                }
            }
        }
    }

}
window.onload= function(){
    activateMenu(\'nav\');
    activateMenu(\'vertnav\');
}
</script>

babylonking


milar

hey,pal
now i have the same error,can you help me?

Advertisement: