Ren_WEB 0 Denunciar post Postado Janeiro 8, 2010 Boa Noite! Estou com o seguinte problema criei um menu dinamico com item e sub item..porem na hora que crio o sub item ele teria que ficar oculto ate que eu clicasse no item!Porem não acontece ele fica visivel junto com o item! me ajudem por favor a corigir o erro!!! Segue o codigo: <?php require_once('Connections/conect.php'); ?> <?php mysql_select_db($database_conect, $conect); $query_master1posicao = "SELECT * FROM posicao ORDER BY nomeposicao ASC"; $master1posicao = mysql_query($query_master1posicao, $conect) or die(mysql_error()); $row_master1posicao = mysql_fetch_assoc($master1posicao); $totalRows_master1posicao = mysql_num_rows($master1posicao); mysql_select_db($database_conect, $conect); $query_detail2menu = "SELECT * FROM menu WHERE posicao = '123456789' ORDER BY nome ASC"; $detail2menu = mysql_query($query_detail2menu, $conect) or die(mysql_error()); $row_detail2menu = mysql_fetch_assoc($detail2menu); $totalRows_detail2menu = mysql_num_rows($detail2menu); $colname_conteudo = "-1"; if (isset($_GET['id_menu'])) { $colname_conteudo = (get_magic_quotes_gpc()) ? $_GET['id_menu'] : addslashes($_GET['id_menu']); } mysql_select_db($database_conect, $conect); $query_conteudo = sprintf("SELECT * FROM conteudo WHERE id_menu = %s", $colname_conteudo); $conteudo = mysql_query($query_conteudo, $conect) or die(mysql_error()); $row_conteudo = mysql_fetch_assoc($conteudo); $totalRows_conteudo = mysql_num_rows($conteudo); ?> <script src="includes/cssmenus2/js/cssmenus.js" type="text/javascript"></script> <script src="includes/cssmenus2/js/cssmenus.js" type="text/javascript"></script> <script src="includes/cssmenus2/js/cssmenus.js" type="text/javascript"></script> <script src="includes/cssmenus2/js/cssmenus.js" type="text/javascript"></script> <link href="includes/cssmenus2/skins/arktic_green/expandable.css" rel="stylesheet" type="text/css" /> <div id="cssMenu1" class="expandable"> <ul class="arktic_green"> <li> <a href="#" title="Quem Somos">Quem Somos</a> <ul> <li> <a href="#" title="Apresentação">Apresentação</a> </li> <li> <a href="#" title="Estrutura">Estrutura</a> </li> <li> <a href="#" title="Localização">Localização</a> </li> </ul> </li> <li> <a href="#" title="Contato">Contato</a> <ul> <li> <a href="#" title="Duvidas Frequentes">Duvidas Frequentes</a> </li> <li> <a href="#" title="Trabalhe Conosco">Trabalhe Conosco</a> </li> </ul> </li> <?php do { ?> <li> <a href="#" title="1"><?php echo $row_master1posicao['nomeposicao']; ?></a> <?php if ($totalRows_master1posicao>0) { $nested_query_detail2menu = str_replace("123456789", $row_master1posicao['nomeposicao'], $query_detail2menu); mysql_select_db($database_conect); $detail2menu = mysql_query($nested_query_detail2menu, $conect) or die(mysql_error()); $row_detail2menu = mysql_fetch_assoc($detail2menu); $totalRows_detail2menu = mysql_num_rows($detail2menu); $nested_sw = false; if (isset($row_detail2menu) && is_array($row_detail2menu)) { do { //Nested repeat ?> <ul> <li> <a href="result.php?id_menu=<?php echo $row_detail2menu['id_menu']; ?>"><?php echo $row_detail2menu['nome']; ?></a> </li> </ul> </li> <?php } while ($row_detail2menu = mysql_fetch_assoc($detail2menu)); //Nested move next } } ?> <?php } while ($row_master1posicao = mysql_fetch_assoc($master1posicao)); ?> </ul> <br /> <script type="text/javascript"> <!-- var obj_cssMenu1 = new CSSMenu("cssMenu1"); obj_cssMenu1.setHighliteCurrent(true); obj_cssMenu1.show(); //--> </script> </div> <?php mysql_free_result($master1posicao); mysql_free_result($detail2menu); mysql_free_result($conteudo); ?> Obrigado! Compartilhar este post Link para o post Compartilhar em outros sites
GabrielFerrari 41 Denunciar post Postado Janeiro 8, 2010 Poste o link da sua página para facilitar :) Compartilhar este post Link para o post Compartilhar em outros sites
Dee 0 Denunciar post Postado Janeiro 8, 2010 Porque você chama 4 vezes isso os scripts ? <script src="includes/cssmenus2/js/cssmenus.js" type="text/javascript"></script> <script src="includes/cssmenus2/js/cssmenus.js" type="text/javascript"></script> <script src="includes/cssmenus2/js/cssmenus.js" type="text/javascript"></script> <script src="includes/cssmenus2/js/cssmenus.js" type="text/javascript"></script> <link href="includes/cssmenus2/skins/arktic_green/expandable.css" rel="stylesheet" type="text/css" /> Precisaríamos de ver esses arquivos para te ajudar. o .js e o .css Compartilhar este post Link para o post Compartilhar em outros sites
Ren_WEB 0 Denunciar post Postado Janeiro 11, 2010 obrigado pela atenção ai vai o codigo: CSS do menu: /************************************************************************* * This is the SKIN style definition for the CSS menu. * * Feel free to customize this section. * *************************************************************************/ /* * Menu container settings * Applies to the first level menu container */ .metal_simple { font-family: Tahoma,Arial,Helvetica,Verdana,sans-serif; font-size: 11px; font-weight: bold; } /* * Menu container settings * Applies to second (or more) level menu containers */ .metal_simple ul { font-weight:normal; } /* * Menu items settings * Applies to all menu items in all menu containers */ .metal_simple li { width:153px; background-image: url(img/metal_grey.gif); background-repeat: no-repeat; margin-bottom: 2px; } /* * Menu items settings * Applies to second (or more) level menu items */ .metal_simple ul li { background-image:none; background-color: #ffffff; padding:0px; margin: 0px; } /* * Menu link settings * Applies to links that are to be found within the menu items, no matter the menu level */ .metal_simple a { text-decoration: none; color:#696969; line-height: 32px; padding: 0px 8px 0px 20px; cursor: pointer; } /* * Menu link settings * Applies to links that are to be found within the second (or more) level menu items */ .metal_simple ul a { color: #505050; line-height: 22px; padding: 0px 8px 0px 20px; } /* * Settings specific to the "METAL SIMPLE" skin only * */ /* this applies to the first/last item of the second (or more) level */ .metal_simple ul li.first, .metal_simple ul li.last { background-image: none; } /*************************************************************************** * In this section, we will define what happens when mouse-overing an item * ***************************************************************************/ /* * Mouse over on menu items * Applies to all menu items in all menu containers */ .metal_simple li.hover { } /* * Mouse over on menu items * Applies to second (or more) level menu items */ .metal_simple ul li.hover { background-image: none; } /* * Mouse over on links * Applies to all links in all menu items */ .metal_simple a.hover { color: #BD032E !important; } /* * Mouse over on links * Applies to links located in the second (or more) level menu items */ .metal_simple ul a.hover { color: #BD032E !important; } /***************************************************************************** * In this section, we will define what happens when a menu item is selected * *****************************************************************************/ /* * Selected menu item * Applies to selected menu items in all menu containers */ .metal_simple li.selected { } /* * Selected menu item * Applies to second (or more) level selected menu items */ .metal_simple ul li.selected { } /* * Selected links * Applies to selected links in all menu items */ .metal_simple a.selected { color:#B5667B; } /* * Selected links * Applies to selected links located in the second (or more) level menu items */ .metal_simple ul a.selected { color:#B5667B; font-weight: bold; } /****************************************************************************** * In this section, we will define the menu arrows behavior * * An arrow is inserted next to the menu item when the menu item has sub-menus * ******************************************************************************/ /* * Define the arrow * Applies to all menu items that have sub-menus */ .metal_simple .arrow { background-image:url(img/arrow_horizontal_dark.gif); background-repeat: no-repeat; background-position: 7px 14px; } /* * Define the arrow * Applies to all menu items that have sub-menus located in the second (or more) level */ .metal_simple .hover ul .arrow, .metal_simple ul .arrow { background-image:url(img/arrow_horizontal_dark.gif); background-position:10px 10px; } /* * Define the arrow on mouse over * Applies to all menu items that have sub-menus on mouse over */ .metal_simple .hover .arrow { background-image:url(img/arrow-red_horizontal.gif); } /* * Define the arrow on mouse over * Applies to all menu items that have sub-menus located in the second (or more) level on mouse over */ .metal_simple ul .hover .arrow { background-image:url(img/arrow_horizontal_white.gif); } /************************************************************************* * This is the LAYOUT style definition for the CSS menu * * DO NOT alter this section, unless you know what you're doing * *************************************************************************/ div.expandable { clear: both; } div.expandable br { clear: both; } div.expandable ul { margin: 0px; padding: 0px; display: block; float: left; clear: both; } div.expandable li { list-style-type: none; display: block; float: left; clear: both; text-align: left; position: relative; } div.expandable li img { border: none; } div.expandable a { clear: both; float: none; display: block; margin: 0px; } div.expandable ul li ul { position: static; visibility: visible; display: block; clear: both; margin: 0px; margin-top: -5000px; } div.expandable ul li ul li ul { display: none; } div.expandable ul li ul li { clear: both; } div.expandable ul li ul li a { clear: both; } .hasImg, .hasImg a { padding: 0px !important; margin: 0px !important; border: none !important; outline: none !important; background: transparent !important; width: auto !important; } tem tambem o link ajuda? Clique aqui Compartilhar este post Link para o post Compartilhar em outros sites