私のコードの例:
<section id="reports">
<div class="report">
<div class="report-expand">MORE</div> <!-- this one is clicked -->
</div>
<ul class="report-moreinfo"></ul> <!-- I want to select this one -->
<div class="report">
<div class="report-expand">MORE</div>
</div>
<ul class="report-moreinfo"></ul>
<div class="report">
<div class="report-expand">MORE</div>
</div>
<ul class="report-moreinfo"></ul>
</section>
これは私のjQueryの一部です:
$('.report').on('click', '.report-expand', function(e) {
// $(this) === '.report-expand'
$(this).closest('.report') // now what..?
}
ul.report-moreinfo
現在選択している に続くを適切に選択するには、トラバースを終了するにはどうすればよい.report
ですか?