Ver Mensaje Individual
  #4 (permalink)  
Antiguo 13/04/2012, 09:29
Avatar de BLAH !!
BLAH !!
 
Fecha de Ingreso: septiembre-2003
Ubicación: Región Metropolitana, Santiago, Chile
Mensajes: 706
Antigüedad: 20 años, 7 meses
Puntos: 16
Exclamación Respuesta: mostrar thumbnail al cargar imagen desde pc en input=type

APORTE: LO ENCONTRE EN UNA WEB, SOLO CON JS

PARA NO PERDER EL FORMATO DE LA IMAGEN PUEDEN BORRAR .width() o .height()

Código:
    <!DOCTYPE html>
    <html>

    <head>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
    <script>
    function readURL(input) {
    if (input.files && input.files[0]) {
    var reader = new FileReader();
    reader.onload = function (e) {
    $('#img_prev')
    .attr('src', e.target.result)
    .width(150);     // ACA ESPECIFICAN QUE TAMANO DE ANCHO QUIEREN
    .height(150);   //  ACA ESPECIFICAN QUE TAMANO DE ALTO QUIEREN
    };
    reader.readAsDataURL(input.files[0]);
    }
    }
    </script>
    <meta charset=utf-8 />
    <title>JS Bin</title>
    <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    </head>

    <body>
    <input type='file' onchange="readURL(this);" />
    <img id="img_prev" src="#" alt="your image" />
    </body>

    </html>
__________________
Adios ...!!!!