我有以下列表:
<div id="topicListContainter">
<ul id="sList" class="sList">
<li id="itemList_11">
0. updated <span class="closeBox" id="11" ><img src="images/close.png"></span>
<div id="comment_actions" class="comment_actions" style="display: none; margin: 5px"><textarea style="width: 100%"></textarea>
<br>
<input type="text" id="date" class="date" /> <input style="margin: 5px" type="button" class="button blue" value="Save" />
</div>
</li>
<li id="itemList_27">
1. Sta ima <span class="closeBox" id="27" ><img src="images/close.png"></span>
<div id="comment_actions" class="comment_actions" style="display: none; margin: 5px"><textarea style="width: 100%"></textarea>
<br>
<input type="text" id="date" class="date" /> <input style="margin: 5px" type="button" class="button blue" value="Save" />
</div>
</li>
<li id="itemList_26">
2. Update 22 <span class="closeBox" id="26" ><img src="images/close.png"></span>
<div id="comment_actions" class="comment_actions" style="display: none; margin: 5px"><textarea style="width: 100%"></textarea>
<br>
<input type="text" id="date" class="date" /> <input style="margin: 5px" type="button" class="button blue" value="Save" />
</div>
</li>
.....
如何<div>
comment_actions
在单击操作时切换和显示/隐藏closeBox
注意:每个<li>
都有自己的comment_actions
div
到目前为止,我已经尝试过类似的东西:
jQuery('.closeBox').live('click', function() {
jQuery(this).next('div').hide();
});