Jump to content
Fórum Script Brasil
  • 0

Menu DropDown - Ajuda


michellepintonit

Question

Olá Pessoal...

estou construindo uma pagina e estou utilizando o menu dropdown...

Até aí tudo bem...

o problema é que, quando eu tento colocar um submenu dentro de um outro submenu, ele começa a travar!

Preciso de um help urgente porque o cliente já esta me cobrando...

segue o codigo que estou utilizando:

function horizontal() {

   var navItems = document.getElementById("menu_dropdown").getElementsByTagName("li");
    
   for (var i=0; i< navItems.length; i++) {
   
      if(navItems[i].className == "submenu")
      {
         if(navItems[i].getElementsByTagName('ul')[0] != null)
         {
            navItems[i].onmouseover=function() {this.getElementsByTagName('ul')[0].style.display="block";}
            navItems[i].onmouseout=function() {this.getElementsByTagName('ul')[0].style.display="none";}
            
            
            
            var newItems = navItems[i].getElementsByTagName('ul');
            newItems = newItems[0].getElementsByTagName("li");
            if(newItems != null)
                for (var i=0; i< newItems.length; i++) {
                    if(newItems[i].className == "newmenu")
                    {
                        if(newItems[i].getElementsByTagName('ul')[0] != null)
                        {
                            newItems[i].onmouseover=function() {this.getElementsByTagName('ul')[0].style.display="block";this.style.backgroundColor = "#f9f9f9";}
                            newItems[i].onmouseout=function() {this.getElementsByTagName('ul')[0].style.display="none";this.style.backgroundColor = "#FFFFFF";}
                        }
                    }
                }
         }
      }
   }

}

Edited by fercosmig
add tags
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652k
×
×
  • Create New...