Ver Mensaje Individual
  #6 (permalink)  
Antiguo 07/05/2010, 08:36
Avatar de David
David
Moderador
 
Fecha de Ingreso: abril-2005
Ubicación: In this planet
Mensajes: 15.720
Antigüedad: 19 años
Puntos: 839
Respuesta: checkbox color con celda

O, para no estar repitiendo código:
Código Javascript:
Ver original
  1. $(function(){
  2.     $(':checkbox').click(checked);
  3.     $(":checkbox:checked").each(checked);
  4. });
  5.  
  6. function checked() {
  7.     if($(this).attr('checked') == true) {
  8.         $(this).parent().attr('style','background:#ff0000;')
  9.     } else {
  10.         $(this).parent().removeAttr('style')
  11.         // o $(this).parent().attr('style','background:#ff0000;') y elejis el color si no esta seleccionado
  12.     }
  13. }
__________________
Por favor, antes de preguntar, revisa la Guía para realizar preguntas.