我想选择' chat-box-frnd-cnt' div应用fadeOut,我尝试过使用:
$(".chat-box, html, body").on("click", '.submitchatnew', function(){
$(this).parent().next('.chat-box-frnd').find('.chat-box-frnd-cnt').fadeOut(500);
});
但它不起作用
HTML:
<div class="chat-box">
<div id="consubmitchatnew">
<input class="submitchatnew" type="submit" value="" />
</div>
<div class="chat-box-frnd">
<div class="chat-box-frnd-img"></div>
<div class="chat-box-frnd-cnt">
<div class="cbf-cnt"><h4></h4></div></div>
<div class="chat-box-frnd-cpng"></div>
<div class="chat-box-frnd-nm"><h3></h3></div>
<div class="cb-frnd-divisor"></div>
</div>
</div>
答案 0 :(得分:0)
你应该使用$(".chat-box").children(".chat-box-frnd-cnt").fadeOut(500);