Ver Mensaje Individual
  #2 (permalink)  
Antiguo 07/09/2010, 15:46
Avatar de tredio
tredio
 
Fecha de Ingreso: noviembre-2008
Ubicación: Carabobo
Mensajes: 466
Antigüedad: 15 años, 5 meses
Puntos: 66
Respuesta: Seleccionar el body excepto un div

prueba con esto

Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. <title>Ejemplo target</title>
  5. body{ height:500px;}
  6. #no_selecciona{ border:solid 1px;}
  7. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
  8. $(document).ready(function(){
  9.     $('body').click(function(ev){
  10.         var target = $(ev.target);
  11.         if(target.not('#no_selecciona').length){
  12.             alert('click body')
  13.         }
  14.     });
  15. });
  16. </head>
  17.  
  18. <div id="no_selecciona">hola</div>
  19. </body>
  20. </html>