行のデータ属性と、クリック時に同じデータ属性を持つ div を表示する機能を備えたテーブルを作成しようとしています。jquery関数をより簡単/スマートにする場合は、さらにデータ属性を追加できます。
すべてをうまくプレイするには、いくつかの助けが必要です:)
前もって感謝します!
編集: jsFiddle リンク: http://jsfiddle.net/MXpnQ/
$(".productRow").click(function () {
$(this).parent().hide("slow"); //hides the fundListContainer
--function to show the correct fundInfoContainer--?
});
$(".backToCorrectListButton").click(function () {
--function to hide the fundInfoContainer and show the correct fundListContainer--?
});
<div class="fundListContainer">
<table>
<tr class="productRow" data-fundId="1">
<td></td>
<td></td>
</tr>
<tr class="productRow" data-fundId="2">
<td></td>
<td></td>
</tr>
</table>
</div>
<div class="fundInfoContainer" data-fundId="1" style="display: none">
<div class="backToCorrectListButton">back to list</div>
</div>
<div class="fundInfoContainer" data-fundId="2" style="display: none">
<div class="backToCorrectListButton">back to list</div>
</div>