Foros del Web » Programando para Internet » Javascript »

esta bien este codigo para mostrar divs sin problemas?

Estas en el tema de esta bien este codigo para mostrar divs sin problemas? en el foro de Javascript en Foros del Web. imagen1 en esta imagen muestro como quiero tener mi pagina, si se fijan en la parte principal tengo un menu, debajo tengo un menu lateral ...
  #1 (permalink)  
Antiguo 20/09/2007, 12:21
Avatar de Gaby_Corr  
Fecha de Ingreso: junio-2005
Mensajes: 672
Antigüedad: 18 años, 10 meses
Puntos: 0
esta bien este codigo para mostrar divs sin problemas?

imagen1

en esta imagen muestro como quiero tener mi pagina, si se fijan en la parte principal
tengo un menu, debajo tengo un menu lateral izquierdo con 4 opciones , que al
darle click a cada una de ellas aparece la parte del lado derecho, que incluye un menu con botones azules, todo iba muy bien, ya que lo tenia dividido con div's que
hacia que al darclick ya sea en el boton de la izq aparecia el contenido de la derecha
peroooo meti una tabla y me poneunos espacios en el contenido, ya que la imagen
se corta de los lados y eso de andar con display: block/none no se si este bien
aca pongo parte del codigo


se aceptan sugerencias de como lo puedo hacer mejor, gracias

scripts
Código:
<script language="JavaScript" type="text/javascript">
     function show_div1()
     {
	   document.getElementById("contentb1").style.display = "block";
	   document.getElementById("contentb2").style.display = "none";
	   document.getElementById("contentb3").style.display = "none";
   	   document.getElementById("contentb4").style.display = "none";
       document.getElementById("plusdin").style.display = "none";	   
       document.getElementById("plusexp").style.display = "none";
       document.getElementById("plusrest").style.display = "none";
	   
     }
	 
	  function show_div2()
     {
	   document.getElementById("contentb2").style.display = "block";
	   document.getElementById("contentb1").style.display = "none";
	   document.getElementById("contentb3").style.display = "none";
       document.getElementById("contentb4").style.display = "none";
       document.getElementById("plusdin").style.display = "none";	   
       document.getElementById("plusexp").style.display = "none";
       document.getElementById("plusrest").style.display = "none";
     }
	 
	
 	 function show_mbasico()
     {
	   document.getElementById("menu_basico").style.display = "block";
   	   document.getElementById("menu_avant").style.display = "none";
   	   document.getElementById("menu_plus").style.display = "none";
	   document.getElementById("menu_construrama").style.display = "none";
       document.getElementById("marco").style.display = "block";
	   document.getElementById("contentb1").style.display = "none";
	   document.getElementById("contentb2").style.display = "none";
       document.getElementById("contentb3").style.display = "none";	
       document.getElementById("contentb4").style.display = "none";	
     }
	 
	  function show_mavan()
     {
 	   document.getElementById("menu_avan").style.display = "block";
	   document.getElementById("menu_basico").style.display = "none";
       document.getElementById("menu_plus").style.display = "none";
       document.getElementById("marco").style.display = "block";
	   document.getElementById("contentb1").style.display = "none";
	   document.getElementById("contentb2").style.display = "none";
       document.getElementById("contentb3").style.display = "none";	
       document.getElementById("contentb4").style.display = "none";	
   	  
     }
	 
	 
	 
</script>
__________________
" Recuerda , estas donde debes estar ..."
  #2 (permalink)  
Antiguo 20/09/2007, 12:23
Avatar de Gaby_Corr  
Fecha de Ingreso: junio-2005
Mensajes: 672
Antigüedad: 18 años, 10 meses
Puntos: 0
Re: esta bien este codigo para mostrar divs sin problemas?

Código:
<!-- tabla principal-->
<table width="100%">
 <tr>
  <td width="20%" style=" vertical-align: top; padding-top: 50px;"><!-- barra lateral izq de menu-->

		<table border="0" cellpadding="0" cellspacing="0">
		  <tr><td><a href="javascript:show_mbasico();" target="_top" onClick="MM_nbGroup('down','group1','Basico','images/bot_L_press_basico.jpg',1)" onMouseOver="MM_nbGroup('over','Basico','images/bot_L_press_basico.jpg','',1)" onMouseOut="MM_nbGroup('out')"><img src="images/bot_L_out_basico.jpg" alt="" name="Basico" width="64" height="19" border="0" onload=""></a></td></tr>
		  <tr><td><a href="javascript:show_mavan();" target="_top" onClick="MM_nbGroup('down','group1','Avan','images/bot_L_press_avant.jpg',1)" onMouseOver="MM_nbGroup('over','Avant','images/bot_L_press_avant.jpg','',1)" onMouseOut="MM_nbGroup('out')"><img src="images/bot_L_out_avant.jpg" alt="" name="Avant" width="59" height="19" border="0" onload=""></a></td></tr>
		  <tr><td><a href="javascript:show_mplus();" target="_top" onClick="MM_nbGroup('down','group1','Plus','images/bot_L_press_plus.jpg',1)" onMouseOver="MM_nbGroup('over','Plus','images/bot_L_press_plus.jpg','',1)" onMouseOut="MM_nbGroup('out')"><img src="images/bot_L_out_plus.jpg" alt="" name="Plus" width="51" height="19" border="0" onload=""></a></td></tr>
		  <tr><td><a href="javascript:show_mconst();" target="_top" onClick="MM_nbGroup('down','group1','Cons','images/bot_L_press_cont.jpg',1)" onMouseOver="MM_nbGroup('over','Cons','images/bot_L_press_contrurama.jpg','',1)" onMouseOut="MM_nbGroup('out')"><img src="images/bot_L_out_.jpg" alt="" name="Cons" border="0" onload=""></a></td></tr>
		</table>


  </td><!-- fin de barra lateral izq de menu-->

  <td width="80%">
  			<table><tr><td>
			
			<div id="menu_basico" style="display:none;"> <!--menu BASICO-->
			<table><!-- barra superior de menu-->
			  <tr>
				<td><a href="javascript: show_div1();" target="_self"  onClick="MM_nbGroup('down','group2','negocio','images/pest_negocio_2.gif',1)" onMouseOver="MM_nbGroup('over','negocio','images/pest_negocio_2.gif','',1)" onMouseOut="MM_nbGroup('out')">
				<img src="images/pest_negocio.gif" alt="negocios" name="negocio" width="131" border="0"  onload="" /></a></td>
				<td><a href="javascript: show_div2();" target="_self" onClick="MM_nbGroup('down','group2','pv','images/pest_punto_venta_2.gif',1)" onMouseOver="MM_nbGroup('over','pv','images/pest_punto_venta_2.gif','',1)" onMouseOut="MM_nbGroup('out')">
				<img src="images/pest_punto_venta.gif" alt="pv" name="pv" width="131" height="56" border="0" onload="" /></a></td>
				<td><a href="javascript: show_div3();" target="_self" onClick="MM_nbGroup('down','group2','rest','images/pest_rest_2.gif',1)" onMouseOver="MM_nbGroup('over','rest','images/pest_rest_2.gif','',1)" onMouseOut="MM_nbGroup('out')">
				<img src="images/pest_rest.gif" alt="restaurant" name="rest" width="131" height="56" border="0" /></a></td>
			  </tr>
			</table>
			</div><!-- fin de menu BASICO-->
			
			<div id="menu_avant" style="display:none;"> <!-- menu AVAN-->
			<table>
			  <tr>
				<td><a href="javascript: show_div1();" target="_self" onClick="MM_nbGroup('down','group3','negocios','images/pest_negocio_2.gif',1)" onMouseOver="MM_nbGroup('over','negocios','images/pest_negocio_2.gif','',1)" onMouseOut="MM_nbGroup('out')">
				<img src="images/pest_negocio.gif" alt="negocios" name="negocios" width="131" border="0"  onload="" /></a></td>
				<td><a href="javascript: show_div2();" target="_self" onClick="MM_nbGroup('down','group3','pvs','images/pest_punto_venta_2.gif',1)" onMouseOver="MM_nbGroup('over','pvs','images/pest_punto_venta_2.gif','',1)" onMouseOut="MM_nbGroup('out')">
				<img src="images/pest_punto_venta.gif" alt="pv" name="pvs" width="131" height="56" border="0" onload="" /></a></td>
				<td><a href="javascript: show_div3();" target="_self" onClick="MM_nbGroup('down','group3','rests','images/pest_rest_2.gif',1)" onMouseOver="MM_nbGroup('over','rests','images/pest_rest_2.gif','',1)" onMouseOut="MM_nbGroup('out')">
				<img src="images/pest_rest.gif" alt="restaurant" name="rests" width="131" height="56" border="0" /></a></td>
				<td><a href="javascript: show_div4();" target="_self" onClick="MM_nbGroup('down','group3','Joyeria','images/pest_joyeria_2.gif',1)" onMouseOver="MM_nbGroup('over','Joyeria','images/pest_joyeria_2.gif','',1)" onMouseOut="MM_nbGroup('out')">
				<img src="images/pest_joyeria.gif" alt="joyeria" name="Joyeria" width="131" height="56" border="0" /></a></td>
			  </tr>
			</table>
           </div>  <!-- fin de menu AVAN-->
		   
				
			
			
			<!-- fin barra superior de menu--> 
			
			</td></tr>
			<tr>
			<td> <!-- tabla del contenido con el marco-->
					<table width="750" border="0" cellpadding="0" cellspacing="0" id="marco" style="display:none;">
				  <tr>
					<td style="background-image:url(images/fondo_B1.gif); background-repeat:no-repeat; height: 18px;"></td>
				  </tr>
				  <tr>
					<td><table border="0" width="680" cellpadding="0" cellspacing="0">
							  <tr>
								<td style="background-image:url(images/fondo_B4.gif); width:24px;"></td>			  
								<td width="680" style=" padding:0;">
								  <div id="contenedor">
									   	  <div id="contentb1" style=" display: none;">
													 <!-- #include file = "doctos.asp"-->

											  </div>
											  <div id="contentb2" style="display:none;">
												 <p> I have no idea what's causing that off the top of my head, 
												  we use very similar code on our hidden divs and don't have
												  that problem in IE that I'm aware of. </p>
											  </div>
											  
											  											  
											    
											
								  </div> <!--fin de div contenedor -->
				
								</td>			  
								<td style="background-image:url(images/fondo_B2.gif); width:24px;"></td>
							  </tr>
							</table>
					</td>
				  </tr>
				
				  <tr>
					<td style="background-image:url(images/fondo_B3.gif); background-repeat:no-repeat; height: 31px;"></td>
				  </tr>
				</table>
			</td> <!-- fin de tabla de contenido -->
			</tr>
			
			</table>
  </td>
 </tr>
</table><!-- fin de tabla principal-->


codigo de tabla DOCTOS.ASP
Código:
<table border="0" cellpadding="0" cellspacing="0" style="background-image: url(images/lineabg.gif); background-repeat:repeat-y; width:680px;">
	<tr><td width="266"><img src="images/docto_tit.gif"></td>
	<td width="408"><img src="images/inst_tit.gif"></td>
	</tr>
	<tr><td>
	   <ul><li class="doc"><a href="basico2.asp" target="_blank">Funciones</a></li>
	   <li class="doc"><a href="basico2.asp" target="_blank">Funciones</a></li>
	  <li class="doc"><a href="basico2.asp" target="_blank">Funciones</a></li>
	  <li class="doc"><a href="basico2.asp" target="_blank">Funciones</a></li>
	  <li class="doc"><a href="basico2.asp" target="_blank">Funciones</a></li>
	  <li class="doc"><a href="basico2.asp" target="_blank">Funciones</a></li>
	  <li class="doc"><a href="basico2.asp" target="_blank">Funciones</a></li>
	   </ul>
  	</td>
	<td>
	  <ul><li class="doc"><a href="basico2.asp" target="_blank">Funciones</a></li>
	  <li class="doc"><a href="basico2.asp" target="_blank">Funciones</a></li>
	  <li class="doc"><a href="basico2.asp" target="_blank">Funciones</a></li>
	   </ul>
	</td></tr>
</table>
__________________
" Recuerda , estas donde debes estar ..."
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 20:32.