Ir para conteúdo

POWERED BY:

Arquivado

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

filipescoob

Posição do Mouse na tela

Recommended Posts

Salve comunidade,

 

Estou com um problema, tenho um codigo que achei na net (não lembro onde foi em algum forum). Porem ele não funciona com tabela só com texto puro na tela, alguem pode me ajudar a fazer ele funcionar com tabela,

 

segue descrição do codigo

 

O codigo server para mostrar uma Div com uma descrição do item ao passar o mouse sobre o texto. Porem se a tela tiver só texto funciona mas se o texto estiver dentro de uma tabela não funciona.

 

<html>	<head> <title>teste</title> <script>	 function mostra(event)	 {   var diferenca;      document.getElementById("flutua").style.display = "inline"      diferenca = document.getElementById("flutua").offsetHeight +10;      document.getElementById("flutua").style.top = event.offsetY - diferenca;   document.getElementById("flutua").style.left = event.offsetX;	 }	 function some()	 {	   document.getElementById("flutua").style.display = "none";	 } </script>	</head>	<body > <div id="flutua" style="border: 1px solid red; background: #e1e2f3; padding: 20px; display: none; position: absolute">kaduzick</div> <BR><BR><BR><BR><BR><BR><BR><BR><BR>                                        <label onmousemove="mostra(event)" onmouseout="some()">teste</label>	</body></html>

segue codigo com texto acima

 

 

<script>	 function mostra(event)	 {   var diferenca;      document.getElementById("flutua").style.display = "inline"      diferenca = document.getElementById("flutua").offsetHeight +10;      document.getElementById("flutua").style.top = event.offsetY - diferenca;   document.getElementById("flutua").style.left = event.offsetX;	 }	 function some()	 {	   document.getElementById("flutua").style.display = "none";	 } </script> <body><div id="flutua" style="border: 1px solid red; background: #e1e2f3; padding: 20px; display: none; position: absolute">kaduzick</div><table width="100" border="0" cellspacing="0" cellpadding="0">  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>	<tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr>  <tr>	<td height="100" align="center" valign="middle"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><img onmousemove="mostra(event)" onmouseout="some()" src="button.gif" width="19" height="17"><label onmousemove="mostra(event)" onmouseout="some()">teste</label></td>  </tr></table></body>

segue codigo com tabela.

 

 

Alguem pode me ajudar...... http://forum.imasters.com.br/public/style_emoticons/default/upset.gif

 

Obrigado

Compartilhar este post


Link para o post
Compartilhar em outros sites

Ae..Cara.. aqui funcionou.. Passei o mouse em cima e a div apareceu, não apareceu no lugar correto, mas apareceu ^^O que especificamente você quer dizer com "não funciona"? Não acontece nda ou funciona mas incorretamente?Explica ae ;-)flw

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.