Ver Mensaje Individual
  #2 (permalink)  
Antiguo 05/04/2011, 06:20
Dany_s
 
Fecha de Ingreso: diciembre-2009
Ubicación: Misiones
Mensajes: 867
Antigüedad: 14 años, 5 meses
Puntos: 65
Respuesta: Bloquear div mientras se recibe información.

se logra con un div transparente encima del form, algo asi

Código HTML:
Ver original
  1.     <head>
  2.         <title>Ejemplo</title>
  3.         <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script>
  4.         <script>
  5.  
  6.         $(function(){
  7.  
  8.             $('form').submit( function(){
  9.                 //Agregar un div al principio del form
  10.                 capa = $('<div class="capaTransparente">').prependTo(this);
  11.                 //Le doy opacidad
  12.                 capa.animate({'opacity': 0.5});
  13.                 //Alguna operacion ajax
  14.                 $.get('dos.jsp', function(){
  15.                     //Cuando termina la solicitud le doy opacidad 0
  16.                     capa.animate({'opacity': 0}, function(){
  17.                         //Cuando termina la animacion borro el div
  18.                         $(this).remove();
  19.                     })
  20.                 });
  21.  
  22.                 return false;
  23.             });
  24.  
  25.         });
  26.  
  27.         </script>
  28.         <style>
  29.  
  30.             form{margin:100px; position:relative; width:250px; height:150px}
  31.             .capaTransparente{position:absolute; height:100%; width:100%; background:#ccc; opacity: 0; filter: alpha(opacity=0); -moz-opacity: 0;}
  32.  
  33.         </style>
  34.     </head>
  35.     <body>
  36.  
  37.     <form>
  38.  
  39.         <select>
  40.             <option>1</option>
  41.         </select>
  42.         <input type="text">
  43.         <input id="enviar" type="submit" value="Enviar">
  44.     </form>
  45.  
  46.  
  47.     </body>
  48. </html>

fijate nomas el css que funcione