Ver Mensaje Individual
  #1 (permalink)  
Antiguo 08/06/2011, 13:06
Avatar de Patriarka
Patriarka
 
Fecha de Ingreso: enero-2011
Ubicación: Moreno, Buenos Aires, Argentina
Mensajes: 2.851
Antigüedad: 13 años, 3 meses
Puntos: 288
se me va el hover

Hola gente de js, necesito si me pueden ayudar en algo.
en una serie de <tr>'s tengo estos estilos, no es mas que un hover:
Código CSS:
Ver original
  1. table#feedback-list tbody tr{  background:white; background-image:url(../images/bg_table_presupuestos.jpg); background-repeat:repeat-x; background-position:bottom;  }
  2. table#feedback-list tbody tr:hover{  background:lightgray; background-image:url(../images/bg_table_presupuestos_on.jpg);  }
luego tengo este metodo:
Código Javascript:
Ver original
  1. function openDiv(id_div, total_bids, id_shipment){
  2.     //dialogBidDetails ES UN DIV, PREGUNTO SI ESTA VISIBLE Y LO OCULTO
  3.     //LUEGO LE DEVUELVO LOS ESTILOS ORIGINALES AL TR
  4.     if(document.getElementById('dialogBidDetails'+id_div+'_'+id_shipment).style.display == 'table-row'){
  5.         document.getElementById('dialogBidDetails'+id_div+'_'+id_shipment).style.display = 'none';
  6.  
  7.     document.getElementById('bid_'+id_div+'_'+id_shipment).style.background= '#E4E4E4';
  8.         document.getElementById('bid_'+id_div+'_'+id_shipment).style.backgroundImage= "url(images/bg_table_presupuestos.jpg)";
  9.     document.getElementById('bid_'+id_div+'_'+id_shipment).style.backgroundRepeat= "repeat-x";
  10.     document.getElementById('bid_'+id_div+'_'+id_shipment).style.backgroundPosition= "bottom";
  11.     }else{
  12.         //SI EL TR NO ESTA VISIBLE PRIMERO LE DEVUELVO A TODOS LOS TR SUS ESTILOS ORIGINALES Y LOS OCULTO
  13.         for(var i=1; i<=total_bids; i++){
  14.             if(document.getElementById('dialogBidDetails'+i+'_'+id_shipment).style.display == 'table-row'){
  15.            document.getElementById('dialogBidDetails'+i+'_'+id_shipment).style.display = 'none'
  16.              
  17.                document.getElementById('bid_'+i+'_'+id_shipment).style.background= '#E4E4E4';
  18.                document.getElementById('bid_'+i+'_'+id_shipment).style.backgroundImage= "url(images/bg_table_presupuestos.jpg)";
  19.                document.getElementById('bid_'+i+'_'+id_shipment).style.backgroundRepeat= "repeat-x";
  20.                document.getElementById('bid_'+i+'_'+id_shipment).style.backgroundPosition= "bottom";
  21.  
  22.             }
  23.         }
  24.         //POR ULTIMO MUESTRO EL TR SELECCIONADO
  25.         document.getElementById('dialogBidDetails'+id_div+'_'+id_shipment).style.display = 'table-row';
  26.         //Y LE DOY EL ESTILO DEL HOVER AL TR SELECCIONADO
  27.     document.getElementById('bid_'+id_div+'_'+id_shipment).style.background= 'lightgray';
  28.         document.getElementById('bid_'+id_div+'_'+id_shipment).style.backgroundImage= "url(images/bg_table_presupuestos_on.jpg)";
  29.  
  30.     }
  31. }

lo que hace es que quede seleccionado el <tr> en donde el usuario hizo un click, si se hace click en el mismo tr este vuelve con estilos origonales y asi. funciona perfecto, pero........

pero problema es que se me va el estilo del hover table#feedback-list tbody tr:hover

que demonios tengo que hacer? si le devuelvo todos sus estilos al tr cuando no esta mas seleccionado

ayuda

Última edición por Patriarka; 08/06/2011 a las 13:14