Visualizzazione dei risultati da 1 a 3 su 3
  1. #1
    Utente di HTML.it L'avatar di StegcO
    Registrato dal
    Aug 2008
    Messaggi
    371

    Menu a Tendina (Non pare DIV)

    Cioa

    utilizzo un piccolissimo script che "dovrebbe" aprire un sotto menu, in parole povere, cliccando su un link espande un DIV, una stupidata direte voi, il punto è che non funziona.. ecco il codice:

    JS
    codice:
    function startmenu()
    {
    document.getElementById('TEST').style.display = "none";
    }
    
    function menufunc(menuId)
    {
    if(document.getElementById(menuId).style.display == "none")
    {
    startmenu();
    document.getElementById(menuId).style.display = "block";
    }
    else
    {
    startmenu();
    }
    }
    Pagina
    codice:
    <body onLoad="javascript:startmenu()">
    
    ...
    
    <table>
    <tr>
    	<td width="16" height="16">[img]images/freccia_1.PNG[/img]</td>
    	<td width="5" height="16"></td>
    	<td width="209" height="16">TEST</td>
    </tr>
    
    <div id="TEST">
    
    	<tr>
    		<td width="230" height="5" colspan="3"></td>
    	</tr>
    	<tr>
    		<td width="16" height="16"></td>
    		<td width="5" height="16"></td>
    		<td width="209" height="16">
    
    			<table width="209" height="" cellspacing="0" cellpadding="0">
    				<tr>
    					<td width="16" height="16">[img]images/cerchio.PNG[/img]</td>
    					<td width="5" height="16"></td>
    					<td width="188" height="16">Legenda</td>
    				</tr>
    				<tr>
    					<td width="209" height="5" colspan="3"></td>
    				</tr>
    				<tr>
    					<td width="16" height="16">[img]images/cerchio.PNG[/img]</td>
    					<td width="5" height="16"></td>
    					<td width="188" height="16">Guarda</td>
    				</tr>
    				<tr>
    					<td width="209" height="5" colspan="3"></td>
    				</tr>
    				<tr>
    					<td width="16" height="16">[img]images/cerchio.PNG[/img]</td>
    					<td width="5" height="16"></td>
    					<td width="188" height="16">Prenota</td>
    				</tr>
    			</table>
    
    		</td>
    	</tr>
    
    </div>
    </table>

  2. #2
    Moderatore di Annunci siti web, Offro lavoro/collaborazione, Cerco lavoro L'avatar di cavicchiandrea
    Registrato dal
    Aug 2001
    Messaggi
    26,133
    togli il primo startmenu(); dopo l'if della funzione menufunc(menuId)
    Cavicchi Andrea
    Problemi con javascript, jquery, ajax clicca qui

  3. #3
    Utente di HTML.it L'avatar di StegcO
    Registrato dal
    Aug 2008
    Messaggi
    371
    Pensare che è bastato mettere il contenuto del DIV dentro un'altra <table> "generale", che robe strane..

    grazie del consigli ocomunque ^^

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.