Ver Mensaje Individual
  #2 (permalink)  
Antiguo 10/03/2005, 05:08
Avatar de peaso
peaso
 
Fecha de Ingreso: enero-2002
Ubicación: Barcelona
Mensajes: 147
Antigüedad: 22 años, 3 meses
Puntos: 0
Bueno, buscando buscando he encontrado lo siguiente (por si a alguien le hace falta):

Código:
<img src="imagen.jpg" alt="" OnLoad="X=ancho_máximo;Y=alto_máximo;if ( this.width > X && this.height < Y ){this.height = ( X * this.height ) / this.width;this.width= X};if (this.width < X && this.height > Y ){this.width = ( Y * (this.width) ) / this.height;this.height= Y};if ( this.width > X && this.height > Y ){if (this.width/this.height>=1){{this.height = ( X * this.height ) / this.width;this.width= X}}else {this.width = ( Y * (this.width) ) / this.height;this.height= Y}}" border="0"  />
Funciona perfectamente y no distorsiona las imágenes: si alguna de las dimensiones es mayor que su máximo, la pone al máximo y modifica la otra.