Ver Mensaje Individual
  #5 (permalink)  
Antiguo 07/05/2010, 08:22
tazzwt
 
Fecha de Ingreso: marzo-2010
Mensajes: 432
Antigüedad: 14 años, 1 mes
Puntos: 11
Respuesta: checkbox color con celda

a muchas gracias entonces el código quedaría así.


Código Javascript:
Ver original
  1. <script languaje="javascript">
  2.  
  3. $(document).ready(function(){
  4.  
  5.     $(':checkbox').click(function(){
  6.       if($(this).attr('checked') == true) {
  7.         $(this).parent().attr('style','background:#ff0000;')
  8.       } else {
  9.         $(this).parent().removeAttr('style')
  10.         // o $(this).parent().attr('style','background:#ff0000;') y elejis el color si no esta seleccionado
  11.       }
  12.     })
  13.    
  14.    
  15.     $(function() {
  16.     $(":checkbox:checked").each(function(i) {
  17.  
  18.      if($(this).attr('checked') == true) {
  19.         $(this).parent().attr('style','background:#ff0000;')
  20.       }
  21.      
  22.       else {
  23.         $(this).parent().removeAttr('style')
  24.         // o $(this).parent().attr('style','background:#ff0000;') y elejis el color si no esta seleccionado
  25.       }  
  26.    
  27.         });
  28.    
  29.     });
  30.    
  31.  
  32. });
  33. </script>