誰もがこの恐ろしいコードの塊を取り除くためのセレクターを提供できますか?
// img is the image element...
var descriptionContent = $(".descriptionContent", img.parent("td").parent("tr").next("tr"));
htmlは次のようになります。
<table>
<tr>
<td><img /></td>
</tr>
<tr>
<td><div class="descriptionContent" /></td>
</tr>
<!-- Repeat n times -->
</table>
ユーザーがimgをクリックした場合、次の(そして次の).descriptionContent
要素を取得する必要があります。
ありがとう、
K