음, 아마도 대신 50 개 테이블을 숨기는, 같은 사용자 정의 개체 또는 뭔가를 정착 것 (50 표 = 1 테이블 대비 비교 오버 헤드). jQuery를 사용하여
다음 (어느 정도 의사)를보십시오 :이 메이크업 감각을 했습니까
var data_rows = $('#table').children('tr');
var region_information = {
0: { name: "Foo", location: "Loo"},
1:{ name: "Bar", location: "Car" },
2{ name: "Car", location: "Garage"}
};
$('.regions').hover(
function() {
//Store the region for *performance*
var this_region = $('this');
/*
Set the values in the table by getting the field corresponding to the substring
The format = region-{n}, where {n} is a positive digit
Repeat this `n` times, according to how many "values" you need to display per table
*/
data_rows.children('field1').text(
region_information[this_region.attr('name').substring(7, 1)]
);
}
);
? 당신의 테이블이 어떻게 생겼는지 모르겠으니 정확하게 어떻게하는지 정확하게 말할 수는 없습니다. 그러나 위의 코드와 같은 의사 코드를 제공 할 수 있으므로 도움이되기를 바랍니다.
감사합니다. 이런 식으로 구현했습니다. 테이블의 셀 위로 반복하고 텍스트를 바꿉니다. – chris