Ver Mensaje Individual
  #3 (permalink)  
Antiguo 04/08/2010, 04:48
Dany_s
 
Fecha de Ingreso: diciembre-2009
Ubicación: Misiones
Mensajes: 867
Antigüedad: 14 años, 5 meses
Puntos: 65
Respuesta: click afuera de un elemento

Código Javascript:
Ver original
  1. <head>
  2. <title>Prueba</title>
  3. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
  4. <script>
  5. $(function(){
  6.      $('body').click(function() {
  7.          alert('click fuera');
  8.      });
  9.  
  10.      $('#midiv').click(function(event){
  11.          event.stopPropagation();
  12.      });
  13. });
  14. </script>
  15. <style>
  16. #midiv{height:200px; width:200px; background:blue}
  17. </style>
  18. </head>
  19. <body>
  20.     <div id="midiv"></div>
  21. </body>
  22. </html>

se puede hacer de muchas formas, pero yo uso este plugin http://benalman.com/projects/jquery-...events-plugin/