호버링 효과로 배경이 #D2DEE8
으로 변경됩니다. 나는 단지 :hover
과 :nth-child(odd)
을 CSS에 사용하고 싶지만 IE8에서는 작동하지 않는다.은 얼룩말 줄무늬 행 작업을 배경색을 유혹 테이블 행을 얻기 위해 노력하는 내가 + 나는 또한 내 테이블 행의 색상 (<code>#fff</code>, <code>#efefef</code>)를 교류하고자하고있어</p> <p>이 한 IE8을 위해 최선의 방법을 기꺼이
나는 호버링을 위해 jQuery를 사용하고 있었지만, 마우스를 가져 가면 그 행을 떠날 때마다 번갈아 나타나는 색 (현재는 n 번째 자식 (홀수)을 만드는 데 사용함)을 제거합니다.
$(".DefaultTable tr").not(".DefaultTable .nohover").hover(
function() {
var color = $(this).css('background')
$(this).css('background', '#D2DEE8');
},
function() {
$(this).css('background', color);
}
);
누구도 날이 알아낼 또는 어느 경우의 쉬운/더 나은 방법을 제공 할 수있는 경우, IE8에 대한 유혹 또는 행에 번갈아, 나는 그것을 감사하겠습니다! 감사!
CSS :
.special-color {
background: #D2DEE8;
}
자바 스크립트 :
var color; //At this point, the `color` variable can be read by both functions
$(".DefaultTable tr").not(".DefaultTable .nohover").hover(
function() {
color = $(this).css('background')
$(this).css('background', '#D2DEE8');
},
function() {
$(this).css('background', color);
}
);
더 나은 방법은 사용하는 것입니다 클래스 이름 :
http://twitter.github.com/bootstrap/#tables – clyfe