Ver Mensaje Individual
  #4 (permalink)  
Antiguo 02/03/2013, 20:17
M3duser
 
Fecha de Ingreso: agosto-2008
Mensajes: 43
Antigüedad: 15 años, 8 meses
Puntos: 1
Respuesta: Esconder DIV si no hay contenido

No me funciona pero no se si es porque en algo están interfiriendo las tablas que tengo dentro del DIV o estoy utilizando mal el JAVASCRIPT


Código Javascript:
Ver original
  1. function esconderDiv(){
  2.         var eldiv=getElementById('esconder');
  3.        if(eldiv.innerHTML == ""){
  4.               eldiv.style.display = none;
  5. }
  6. }


Código HTML:
Ver original
  1. <div id="esconder"><?php do { ?>
  2.                     <table width="600" border="0" cellpadding="0" cellspacing="0">
  3.                       <tr>
  4.                         <td width="20">&nbsp;</td>
  5.                         <td><table width="100%" border="0" cellpadding="5" cellspacing="0" class="borderListaHoteles">
  6.                           <tr>
  7.                             <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
  8.                               <tr>
  9.                                 <td><img src="images/Hoteles/1.jpg" width="130" height="87" alt="imagenes"></td>
  10.                               </tr>
  11.                             </table></td>
  12.                             <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
  13.                               <tr>
  14.                                 <td width="500" height="30" class="Title"><?php echo $row_Pago['Hotel']; ?></td>
  15.                                 <td width="79" align="right"><table width="79" border="0" cellpadding="0" cellspacing="0">
  16.                                   <tr>
  17.                                     <td>&nbsp;</td>
  18.                                   </tr>
  19.                                 </table></td>
  20.                               </tr>
  21.                             </table>
  22.                               <table width="100%" border="0" cellpadding="0" cellspacing="0">
  23.                                 <tr>
  24.                                   <td><table border="0" cellpadding="0" cellspacing="0">
  25.                                     <tr>
  26.                                       <td class="textoListaHoteles"><p><?php echo $row_Pago['Habitaciones']; ?><br>
  27.                                         <?php echo $row_Pago['Direccion']; ?><br>
  28.                                         <?php echo $row_Pago['Destino']; ?> &nbsp; &nbsp;<?php echo $row_Pago['Estado']; ?><br>
  29.                                         <br>
  30.                                       </p></td>
  31.                                     </tr>
  32.                                   </table></td>
  33.                                 </tr>
  34.                                 <tr>
  35.                                   <td height="10"></td>
  36.                                 </tr>
  37.                               </table></td>
  38.                           </tr>
  39.                         </table></td>
  40.                       </tr>
  41.                     </table>
  42.                     <?php } while ($row_Pago = mysql_fetch_assoc($Pago)); ?> </div>