Visualizzazione dei risultati da 1 a 3 su 3
  1. #1
    Utente di HTML.it
    Registrato dal
    Aug 2001
    Messaggi
    1,482

    Non nascondere una tabella si il mouse c'è sopra

    Ho una tabella(Tabella1), se posiziono il mouse sopra una cella(Cella1), sotto di questa appare un'altra tabella(Tabella2). Se sposto il mouse fuori dalla cella(Cella1) la tabella(Tabella2) Scompare, se invece sposto il mouse dalla cella (Cella1) e lo posiziono sulla tabella(Tabella2) questa non deve scomparire.

    Ho buttato giù questo codice, ma ovviamente non funziona:

    codice:
    <script Language="JavaScript">
    
    _Over = "False";
    
    function MNShow(IntMN) //Mouse sulla cella (Cella1)
    {
    document.getElementById('MNTD' + IntMN).style.backgroundColor='#FFCC00';
    document.getElementById('SMNTable' + IntMN).style.visibility='visible';
    document.getElementById('SMNTable' + IntMN).style.left = document.getElementById('MNTD' + IntMN).style.left;
    }
    
    function MNHide(IntMN) //Mouse Fuori dalla cella (Cella1)
    {
    If (_Over == "False") //Errore!!!
    {
    document.getElementById('MNTD' + IntMN).style.backgroundColor='#CCCCCC';
    document.getElementById('SMNTable' + IntMN).style.visibility='hidden';
    }
    }
    
    function SMNOver(IntMN) //Mouse sulla tabella (Tabella2)
    {
    _Over = "True"
    }
    
    function SMNOut(IntMN) //Mouse Fuori dalla tabella (Tabella2)
    {
    _Over = "False"
    }
    </script>
    Grazie.

    Hey hey, my my Rock and roll can never die!

  2. #2
    Utente di HTML.it
    Registrato dal
    Aug 2003
    Messaggi
    709
    Qualcosa del genere?
    codice:
    <html>
    
    <head>
    	<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
    	<title>Prova</title>
    	<style>
    	<!--
    	#maintab	{position: absolute; top: 0%; left: 0%; width: 100%; height: 100%; visibility: visible}
    	#lay1	{position: absolute; top: 10%; left: 0%; visibility: hidden}
    	#lay2	{position: absolute; top: 10%; left: 33%; visibility: hidden}
    	#lay3	{position: absolute; top: 10%; left: 66%; visibility: hidden}
    	//-->
    	</style>
    	<script language="JavaScript">
    	<!--
    	function setVis(id,vis) {
    		window.document.getElementById(id).style.visibility=vis;
    	}
    	//-->
    	</script>
    </head>
    
    <body bgcolor="#ffffff">
    	<div id="maintab">
    	<table width="100%" height="100%" border="1">
    		<tr height="10%">
    			<td  width="33%" onMouseOver="setVis('lay1','visible')" onMouseOut="setVis('lay1','hidden')">link1</td>
    			<td  width="33%" onMouseOver="setVis('lay2','visible')" onMouseOut="setVis('lay2','hidden')">link2</td>
    			<td  width="33%" onMouseOver="setVis('lay3','visible')" onMouseOut="setVis('lay3','hidden')">link3</td>
    		</tr>
    		<tr height="90%">
    			<td  width="33%"></td>
    			<td  width="33%"></td>
    			<td  width="33%"></td>		
    		</tr>
    	</table>
    	</div>
    
    	<div id="lay1" onMouseOver="setVis('lay1','visible')" onMouseOut="setVis('lay1','hidden')">
    	<table border="1">
    		<tr>
    			<td>tabella1</td>
    		</tr>
    	</table>
    	</div>
    
    	<div id="lay2" onMouseOver="setVis('lay2','visible')" onMouseOut="setVis('lay2','hidden')">
    	<table border="1">
    		<tr>
    			<td>tabella2</td>
    		</tr>
    	</table>
    	</div>
    
    	<div id="lay3" onMouseOver="setVis('lay3','visible')" onMouseOut="setVis('lay3','hidden')">
    	<table border="1">
    		<tr>
    			<td>tabella3</td>
    		</tr>
    	</table>
    	</div>
    </body>
    
    </html>

  3. #3
    Utente di HTML.it
    Registrato dal
    Aug 2001
    Messaggi
    1,482
    Grazie

    Hey hey, my my Rock and roll can never die!

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.