Ver Mensaje Individual
  #4 (permalink)  
Antiguo 27/01/2011, 06:56
Dany_s
 
Fecha de Ingreso: diciembre-2009
Ubicación: Misiones
Mensajes: 867
Antigüedad: 14 años, 5 meses
Puntos: 65
Respuesta: Agrupar etiquetas CSS en Jquery

http://api.jquery.com/not-selector/
http://api.jquery.com/has-selector/

Código HTML:
Ver original
  1.     <head>
  2.         <title>Ejemplo</title>
  3.         <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
  4.         <script>
  5.             $(function(){
  6.                 $('div:not(:has(ul))').hover( function(){
  7.                    $(this).css('background', 'red');
  8.                 }, function(){
  9.                     $(this).css('background', 'blue');
  10.                 });
  11.             });
  12.         </script>
  13.     </head>
  14.     <body>
  15.  
  16.         <div>
  17.             div con ul
  18.             <ul>
  19.                 <li>li</li>
  20.             </ul>
  21.         </div>
  22.         <div>div sin ul</div>
  23.  
  24.     </body>
  25. </html>