まあ、私はおそらくそのようにカスタムオブジェクトか何かのために解決、代わりの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