Ver Mensaje Individual
  #4 (permalink)  
Antiguo 27/09/2010, 09:02
Dany_s
 
Fecha de Ingreso: diciembre-2009
Ubicación: Misiones
Mensajes: 867
Antigüedad: 14 años, 5 meses
Puntos: 65
Respuesta: Jquery: evento click hacia un input file

no me hacia caso lanzar un click, busqué un rato y según lo que leí en firefox no se puede por algo de seguridad

Lo primero que hice fue darle opacidad 0 al input y colocar un texto encima, funcionaba pero en ie habia que dar doble click. En ie cuando das click en un label se abre la ventana pero en ie no, entonces uso el input arriba y en ie uso el label arriba, el *height:0; es porque me queda el puntero y con eso no aparece

probá que onda, es solo css

Código HTML:
Ver original
  1.     <head>
  2.         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  3.         <title>Prueba</title>
  4.     </head>
  5.     <style>
  6.  
  7.     #divInput{
  8.         width:100px;
  9.         height:20px;
  10.         overflow:hidden;
  11.         background:red;
  12.         position:relative
  13.     }
  14.     #divInput label{
  15.         overflow:hidden;
  16.         position:absolute;
  17.         z-index:1;
  18.         *z-index:2
  19.     }
  20.     #elInput{
  21.         position:absolute;
  22.         -moz-opacity:0 ;
  23.         filter:alpha(opacity: 0);
  24.         opacity: 0;
  25.         z-index:2;
  26.         *z-index:1; *height:0;
  27.     }
  28.  
  29.     </style>
  30.     <body>
  31.  
  32.         <div id="divInput">
  33.             <label for="elInput">Buscar archivo</label>
  34.             <input type="file" id="elInput" />
  35.         </div>
  36.  
  37.     </body>
  38. </html>




si no te sirve busca otros scripts, vi muchos ejemplos que usan css y javascript