Archivo de Mayo de 2009

Limitar peso imagen php

Miércoles, 13 de Mayo de 2009

Función  para saber el peso del archivo.

filesizestring $nombre_archivo );

Reescalar imagenes con PHP

Miércoles, 13 de Mayo de 2009

function imageResize($width, $height, $target) {

//takes the larger size of the width and height and applies the 
formula accordingly…this is so this script will work 
dynamically with any size image

if ($width > $height) {
$percentage = ($target / $width);
} else {
$percentage = ($target / $height);
}

//gets the new value and applies the percentage, then rounds the value
$width = round($width * $percentage);
$height = round($height * $percentage);

//returns the new sizes in html image tag format…this is so you
can plug this function inside an image tag and just get the

return “width=\”$width\” height=\”$height\”";

}

Abrir correctamente un popup en javascript

Miércoles, 13 de Mayo de 2009

Código:
<a href=”pagina.htm” target=”_blank”
onclick=”window.open(this.href,this.target,’width=400, height=250,top=120,left=100,toolbar=no,location=no,status=no, menubar=no’);return false;”>Mi popup mal hecho</a>
Parametros:

  • width=pixeles: el ancho en píxeles del nuevo popup.
  • height=pixeles: el alto en píxeles del nuevo popup.
  • toolbar=yes|no: indica si se muestra o no la barra del navegador.
  • location=yes|no: indica si se muestra o no la barra de direcciones.
  • status=yes|no: indica si se muestra o no la barra de estado.
  • menubar=yes|no: indica si se muestra o no la barra de menú.
  • scrollbars=yes|no: indica si se muestran o
    no las barras de scroll.
  • top=pixeles: indica la posición de la ventana desde su borde superior hasta la parte superior de la pantalla.
  • left=pixeles: indica la posición de la ventana desde su borde izquierdo hasta la parte izquierda de la pantalla.