Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

PurI

Menu drop down cai fora...

Recommended Posts

Opa.

 

Estou fazendo um menu drop down e segui o tutorial aqui do fórum.

 

Acontece que o menu sai se eu passo com o mouse mais devagar, se for rápido vai beleza. No site final do tuto, ele funciona certinho, mesmo indo devagar com o mouse.

 

O site está aqui: http://www.inf.furb.br/~puri/teste/

 

Alguém sabe o que pode ser?

 

<html><head><title>menu</title><style>	body,p,table,td.input,textarea{		font-family:Verdana, Arial, Helvetica, sans-serif;		font-size:11px;		color:#000033;	}	a{ 		text-decoration:none;		color:#000000;	}	.special {		position:relative; 		top:0px; 		left:0px; 		background-color:#ffffff;	}</style><script language="javascript">function menu(){	submenu = [];	for(i=0; i<6; i++) submenu[i] = [];	textmenu = [];	for(i=0; i<6; i++) textmenu[i] = [];	textmenu[0][0] = ["Home","Empresa","Matriz","Filial"]	textmenu[0][1] = ["","","","",""];	textmenu[1][0] = ["Casamentos","Formaturas","Studio","Gestante","Comunhões"]	textmenu[1][1] = ["","","","","","",""];	textmenu[2][0] = ["Revelação Digital", "Dicas"]	textmenu[2][1] = ["","","","","",""];	textmenu[3][0] = ["Adicionar a Favoritos","Configurar","Excluir Favoritos"]	textmenu[3][1] = ["","",""];	textmenu[4][0] = ["Sincronizar","Windows Update","Messenger","Opcoes de Internet"]	textmenu[4][1] = ["","","",""];	textmenu[5][0] = ["Conteudo e Indice","Dica do Dia","Suporte On-line","Enviar Comentarios","Sobre o Internet Explorer"]	textmenu[5][1] = ["","","","",""];	menus = [];	if(document.getElementById){		menus[0] = document.getElementById("Layer1");		menus[1] = document.getElementById("Layer2");		menus[2] = document.getElementById("Layer3");		menus[3] = document.getElementById("Layer4");		menus[4] = document.getElementById("Layer5");		menus[5] = document.getElementById("Layer6");		menuinterno = document.getElementById("menu");		//menu.setAttribute("position","absolute")		function over(){ this.style.backgroundColor = '#B2B4BF'; }		function out(){ this.style.backgroundColor = '#ffffff'; }		function show(){ this.style.visibility='visible'; }		function hide(){ this.style.visibility='hidden'; }		for(j=0; j<textmenu.length; j++){				for (i=0; i<textmenu[j][0].length; i++){				//alert(textmenu[j][0][i])				textmenu[j][0][i] = "<a href='"+textmenu[j][1][i]+"' target='_blank'>" + textmenu[j][0][i] + "</a>";				submenu[j][i] = document.createElement("DIV");				submenu[j][i].setAttribute("className", "special");				submenu[j][i].innerHTML = textmenu[j][0][i];				submenu[j][i].style.padding = "5px";				submenu[j][i].onmouseover = over;				submenu[j][i].onmouseout = out;				menus[j].appendChild(submenu[j][i]);			}			menus[j].style.top = (parseInt(menuinterno.style.top)+parseInt(menuinterno.style.height));			menus[j].onmouseover = show;			menus[j].onmouseout = hide;		}			}}window.onload = menu;</script></head><body><div id="Layer1" style="position:absolute; left:11px; top:37px; width:110px; padding:2px; z-index:1; background-color:#ffffff; border:1px solid #000000; visibility:hidden"></div><div id="Layer2" style="position:absolute; left:110px; top:37px; width:110px; padding:2px; z-index:1; background-color:#ffffff; border:1px solid #000000; visibility:hidden"></div><div id="Layer3" style="position:absolute; left:210px; top:37px; width:110px; padding:2px; z-index:1; background-color:#ffffff; border:1px solid #000000; visibility:hidden"></div><div id="Layer4" style="position:absolute; left:310px; top:37px; width:110px; padding:2px; z-index:1; background-color:#ffffff; border:1px solid #000000; visibility:hidden"></div><div id="Layer5" style="position:absolute; left:410px; top:37px; width:110px; padding:2px; z-index:1; background-color:#ffffff; border:1px solid #000000; visibility:hidden"></div><div id="menu" style="position:absolute; top:10px; left:10px; width:503px; height:37px; z-index:1000;"><table id="Table_01" width="503" height="37" border="0" cellpadding="0" cellspacing="0"><tr>	<td colspan="7"><img src="imagens/barra_01.gif" width="503" height="2" alt=""></td></tr><tr>	<td rowspan="2"><img src="imagens/barra_02.gif" width="2" height="35" alt=""></td>		<td width="99"><a href="java script:void(null)" onMouseOver="menus[0].onmouseover()" onMouseOut="menus[0].onmouseout()"><img src="imagens/barra_03.gif" width="99" height="33" border="0"></a></td>	<td width="100"><a href="java script:void(null)" onMouseOver="menus[1].onmouseover()" onMouseOut="menus[1].onmouseout()"><img src="imagens/barra_04.gif" width="100" height="33" border="0"></a></td>	<td width="100"><a href="java script:void(null)" onMouseOver="menus[2].onmouseover()" onMouseOut="menus[2].onmouseout()"><img src="imagens/barra_05.gif" width="100" height="33" border="0"></a></td>	<td width="100"><a href="java script:void(null)" onMouseOver="menus[3].onmouseover()" onMouseOut="menus[3].onmouseout()"><img src="imagens/barra_06.gif" width="100" height="33" border="0"></a></td>	<td width="100"><a href="java script:void(null)" onMouseOver="menus[4].onmouseover()" onMouseOut="menus[4].onmouseout()"><img src="imagens/barra_07.gif" width="100" height="33" border="0"></a></td>		<td rowspan="2"><img src="imagens/barra_08.gif" width="2" height="35" alt=""></td></tr><tr>	<td colspan="5"><img src="imagens/barra_09.gif" width="499" height="2" alt=""></td></tr></table></div></body></html>

Compartilhar este post


Link para o post
Compartilhar em outros sites

muda lá:

menus[j].style.top = (parseInt(menuinterno.style.top)+parseInt(menuinterno.style.height));
para:

menus[j].style.top = (parseInt(menuinterno.style.top)+parseInt(menuinterno.style.height))-2;

F.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Fleury, agradeço a ajuda, mas não adiantou.O que mais poderia ser?

Compartilhar este post


Link para o post
Compartilhar em outros sites

tem 1 pixel de diferença entre o menu e os submenus. Quando o mouse passa por este pixel, significa que o mouse não está no menu e nem nos submenus e por isso os submenus são escondidos.tem duas soluções, fazer com que não tenha esse pixel ou criar um timer, o que daria um bom trabalho..F.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Obrigado Fleury. Vou ver o que fazer com este pixel hehehe. Pelo menos já se sabe onde está a fonte do problema.Valew!

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.