Ver Mensaje Individual
  #1 (permalink)  
Antiguo 24/06/2010, 18:48
Avatar de juanito1712
juanito1712
 
Fecha de Ingreso: mayo-2010
Ubicación: Valencia
Mensajes: 1.124
Antigüedad: 14 años
Puntos: 66
veis algun motivo para que no funcione en chrome?

Código HTML:
<table id="visor"  border="0" width="100%" height="100%" cellpadding="0" cellspacing="0" style="float:left; position:absolute; top:0px; left:0px; display:none; z-index:5;">
   <tr><td valign="middle" align="center" width="100%"  height="100%">
        <div id="ventana" style="width:350px; height:300px; background-color:#FFFFFF; padding-top:10px;"> 
        		<img id="imagen" />
                <a href="javascript:ocultar();"><div id="cerrar" style="background-color:#00FF00; width:10px; height:10px; top:10px; right:0px;">
                </div></a>
        </div>
   </td></tr>
</table> 
Código Javascript:
Ver original
  1. if (ajax.readyState == 4) {
  2.            
  3.                 document.getElementById(capa).innerHTML=ajax.responseText;
  4.                 document.getElementById(capa).style.width=document.getElementById("imagen").width+20;
  5.                 document.getElementById(capa).style.height=document.getElementById("imagen").height+50;
  6.                
  7.                
  8.              }

el problema son los estilos, lo del ajax solo es para situarse, en iexplore funciona perfectamente pero en chrome no ajusta el tamaño




solucion
Cita:
Tienes que poner +'px' al final

document.getElementById(capa).style.width=document .getElementById("imagen").width+20+'px';

Última edición por juanito1712; 25/06/2010 a las 07:05