我有一个小 jquery 显示/隐藏脚本。我遇到的问题是它显示了所有的选择器。我只希望它显示被点击的 div 内的那个。
HTML
<!--row1 -->
<div class="row resource-line-item">
<div class="zone1">
<h3 class="clickable">ANDALE.TTF - True Type Font</h3>
<span class="edit-resource">Edit</span>
</div>
<div class="zone2 printer-state">
<p> Size: 4153344 <br>
Date: Tuesday, March 26, 2013 2:14:14 PM</p>
</div>
<div style="display: none;" class="edit-Box"> </div>
</div>
<!--row2 -->
<div class="row resource-line-item">
<div class="zone1">
<h3 class="clickable">ANDALE.TTF - True Type Font</h3>
<span class="edit-resource">Edit</span>
</div>
<div class="zone2 printer-state">
<p> Size: 4153344 <br>
Date: Tuesday, March 26, 2013 2:14:14 PM</p>
</div>
<div style="display: none;" class="edit-Box"> </div>
</div>
查询
<script type="text/javascript">
$("#resource-list-area .edit-resource").on("click", function(event){
$(this).next(".edit-box").toggle();
//alert('hello')
});
</script>