Ver Mensaje Individual
  #1 (permalink)  
Antiguo 02/03/2007, 15:06
braiank
 
Fecha de Ingreso: diciembre-2005
Mensajes: 249
Antigüedad: 18 años, 4 meses
Puntos: 0
Funcion para abrir foto

Tengo la siguiente funcion :

Código PHP:
function foto(imagen){
  
newWindow window.open('','','toolbar=no,location=no,scrollbars=no,resizable=no,width=300,height=300,top=0,left=0');
  
newWindow.document.write("<html><head>\n<title>I Aora Ke Paza?</title>\n");
  
newWindow.document.write("<script language=\"javascript\">\n");
  
newWindow.document.write("function tamanio(){ \n imagen = new Image \n imagen.src = \""+imagen+"\" \n");
  
newWindow.document.write(" posH = (screen.width) ? (screen.width-imagen.width)/2 : 0; \n posV = (screen.height) ? (screen.height-imagen.height)/2 : 0; \n");
  
newWindow.document.write(" ancho = imagen.width+12 \n alto = imagen.height+31 \n self.moveTo(posH,posV) \n self.resizeTo(ancho,alto) \n} \n"+unescape("%3C")+"/script>\n</head>\n");
  
newWindow.document.write("<body bgcolor=\"black\" leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">\n");
  
newWindow.document.write("<img src=\""+imagen+"\" onClick=\"self.close();\" border=\"0\" onLoad=\"tamanio();\">\n</body></html>\n\n\n");

y ejecuto una foto asi por ejemplo :

Código PHP:
<a href="javascript:foto('fotos/estudio/008.jpg')"><img src="fotos/estudio/008.jpg" width="173" height="150" border="0"></a
pero el problema es que la foto cuando se abre en la ventana se abre bien pero queda un poco cortada de abajo , osea la ventana no se ajusta 100% a la imagen :S

alguien sabe por que?
saludos